Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. @Override
  2. public void addShop(AdressItem shop) throws SQLException {
  3. Session session = null;
  4. try {
  5. session = HibernateUtil.getSession();
  6. session.beginTransaction();
  7. session.save(shop);
  8. session.getTransaction().commit();
  9. } catch (HibernateException e) {
  10. e.printStackTrace();
  11. } finally {
  12. if (session != null)
  13. if (session.isOpen())
  14. session.close();
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement