Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void addShop(AdressItem shop) throws SQLException {
- Session session = null;
- try {
- session = HibernateUtil.getSession();
- session.beginTransaction();
- session.save(shop);
- session.getTransaction().commit();
- } catch (HibernateException e) {
- e.printStackTrace();
- } finally {
- if (session != null)
- if (session.isOpen())
- session.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement