I integrated the struts and hibernate and wrote the following query in the databean to update the user table login time
SessionFactory sessionFactory = (SessionFactory)context.getAttribute(HibernatePlugin.KEY_NAME); Session session = sessionFactory.openSession(); Query query = session.createQuery("update LoginForm set logintime = '"+loginTime+"' where userid ='"+userId+"'"); int result = query.executeUpdate(); System.out.println("result : "+result); if(result>0) System.out.println("Updated Successfully");
userid and logintime is provided correctly. And the result showed me 1 in the print statement but my database isn't updating...
Thanks in Advance
make sure that ur config file having
how to make config file true
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.