Guest User

Untitled

a guest
Oct 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class ManageAccounts extends HttpServlet{
  2.  
  3. @Override
  4. protected void doPost(HttpServletRequest request, HttpServletResponse response)
  5. throws ServletException, IOException {
  6.  
  7. SessionFactory factory = HibernateUtil.GetSessionFactory();
  8. Session hibernateSession = factory.openSession();
  9. Transaction tx = null;
  10. List<AccountTypes> accountTypesList = null;
  11. try {
  12. tx = hibernateSession.beginTransaction();
  13. accountTypesList = hibernateSession.createQuery("FROM AccountTypes").list();
  14. for (Iterator iterator = accountTypesList.iterator(); iterator.hasNext(); ) {
  15. AccountTypes accountTypes = (AccountTypes) iterator.next();
  16. }
  17. tx.commit();
  18. } catch (HibernateException e) {
  19. if (tx != null) tx.rollback();
  20. e.printStackTrace();
  21. } finally {
  22. hibernateSession.close();
  23. }
  24. }
  25.  
  26. <div class="row text-right">
  27. <label>
  28. Show
  29. <select name="cls" id="cls">
  30.  
  31. </select>
  32. </label>
  33. </div>
  34. <div class="row">
  35. <label>
  36. Show
  37. <select name="group" id="group">
  38.  
  39. </select>
  40. </label>
  41. </div>
Add Comment
Please, Sign In to add comment