SHARE
TWEET

Untitled

a guest Jul 21st, 2019 145 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int Id;
  2.     String email= request.getParameter("email");
  3.     String password= request.getParameter("password");
  4.     UserLog ul = new UserLog(email, password);
  5.  
  6.     Session session= HibernateUtil.getSessionFactory().openSession();
  7.     Query query = session.createQuery("from UserLog");
  8.     List users = query.list();
  9.     Transaction t = session.beginTransaction();
  10.  
  11.     Id = (int) session.save(ul);
  12.     t.commit();
  13.     session.close();
  14.     response.sendRedirect("index.jsp");
  15.      
  16. int user_id;
  17.     String name= request.getParameter("name");
  18.     String lname= request.getParameter("lname");
  19.     String username= request.getParameter("username");
  20.     String email = request.getParameter("email");
  21.     String password = request.getParameter("password");
  22.     String password2 = request.getParameter("password2");
  23.  
  24.     User u = new User(name, lname, username, email, password, password2);
  25.  
  26.     Session session= HibernateUtil.getSessionFactory().openSession();
  27.     Query query = session.createQuery("from User");
  28.     List users = query.list();
  29.  
  30.     Transaction t = session.beginTransaction();
  31.     user_id = (int) session.save(u);
  32.     session.save(u);
  33.     t.commit();
  34.     session.close();
  35.     response.sendRedirect("index.jsp");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top