Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6073577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:17:10+00:00 2026-05-23T10:17:10+00:00

im using hibernate with my jsp page and mySQL ,how can i do that

  • 0

im using hibernate with my jsp page and mySQL ,how can i do that select * from student wher userName = *** with HQL

and how i chek if that username exist in ‘Student’ table ?

in my sql i use that

ResultSet resultat = statement.executeQuery();

if (resultat.next()) { ....}

i try this

Session hibernateSession = MyDB.HibernateUtil.currentSession(); 
hibernateSession.find("select xxx from Etudinat where p.Nom=xxxx");

its give me a list but

i have a login form send me a username and password

i want to chek if that username exist in the table Student to set the user on a session

what is the safty way to do that

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:17:10+00:00Added an answer on May 23, 2026 at 10:17 am

    I could not paste code into the comment. Try the following HQL:

    from Etudinat where Nom = 'xxxx'
    

    Even better, pass the username as a parameter.

    Per OP request, code snippet based on the comments:

        Query q = hibernateSession.createQuery("from Etudinat where Nom = :username");
    q.setParameter("username", xxxx);       
    Etudinat e = q.uniqueResult();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at this java web application that is using hibernate, jsp's, and spring
I'm writing a website in JSP using Struts and Hibernate. I'm looking for a
So I'm using hibernate and working with an application that manages time. What is
I'm using hibernate 3 and want to stop it from dumping all the startup
I am using Hibernate 3.x, MySQL 4.1.20 with Java 1.6. I am mapping a
I am using Hibernate search. I have a search text box in my jsp
I am using Spring Web MVC and Hibernate for developing my application. My login.jsp
am using hibernate merge method, to deal with detached instance from entity, and i
I'm using Hibernate/JPA and have an @Entity object called Order, pointing at a MySQL
I'm using Hibernate 3.5.5.Final and JPA2 How can make a testcase to test if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.