By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,880 Members | 723 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,880 IT Pros & Developers. It's quick & easy.

How to edit existing record using jsp

P: 250
I'm new to java.I,m developing web application using jsp,struts,hibernet. I want to edit database record. This is my code and when I edit and save it it didn't update record but add a new one. Please help me..

Expand|Select|Wrap|Line Numbers
  1.         UserAdminActionForm formbean = (UserAdminActionForm) form;
  2.         String fullname = formbean.getFullname();
  3.         String email = formbean.getEmail();
  4.         Session s = data.DataAccess.getDataAccess().getSession();
  5.         Transaction tr = s.beginTransaction();
  7.         data.UserAccount user = new data.UserAccount();
  9.         user.setFullName(fullname);
  10.         user.setEmail(email);
  11.         s.update(user);
  12.         tr.commit();
Jun 9 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.