how to check if a data exist on a table using hibernate
- by David
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");
thats give an exception so how can i do that ?
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