I created a login application using struts2 and hibernate. I get login details from Login table and stored into list in hibernate dao class. That list is passed to the login_action class.In action class I am using iterator to get the value, but I want store the database value(not a object) in array list in dao class. How to store a value(ex:david,103) into array list in dao class
public class DAOClass {
...
public List getPwd(LoginModel lm) {
Session session=null;
List pwdlist = null;
session = sessionfactory.openSession();
try {
Query q=session.createQuery("from LoginModel l where UId='"+lm.getUname()+"'");
pwdlist=q.list();
} catch (Exception e){
e.printStackTrace();
}
return pwdlist;
}
}