Advertisement
Guest User

Untitled

a guest
Jan 9th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. Student s1 = new Student();
  2. s1.setName("Monaj");
  3. s1.setRoll(1);
  4. s1.setDate(new Date());
  5.  
  6. Configuration configuration = new Configuration().configure();
  7. serviceRegistry = new StandardServiceRegistryBuilder()
  8. .applySettings(configuration.getProperties()).build();
  9. sessionFactory = configuration.configure()
  10. .buildSessionFactory(serviceRegistry);
  11.  
  12. Session session=sessionFactory.openSession();
  13. Transaction t1=session.beginTransaction();
  14. session.save(s1);
  15. t1.commit();
  16. session.close();
  17.  
  18. 15:29:08.476 [main] DEBUG o.h.e.j.i.LogicalConnectionImpl - Aggressively releasing JDBC connection
  19. 15:29:08.476 [main] DEBUG o.h.e.j.i.LogicalConnectionImpl - Releasing JDBC connection
  20. 15:29:08.476 [main] DEBUG o.h.e.j.i.LogicalConnectionImpl - Released JDBC connection
  21. 15:29:08.477 [main] DEBUG o.h.e.j.internal.JdbcCoordinatorImpl - HHH000420: Closing un-released batch
  22. 15:29:37.323 [pool-1-thread-1] DEBUG o.h.e.j.c.i.DriverManagerConnectionProviderImpl - Connection pool now considered primed; min-size will be maintained
  23.  
  24. <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  25. <property name="connection.url">jdbc:mysql://localhost/test</property>
  26. <property name="connection.password">password</property>
  27. <property name="connection.username">admin</property>
  28. <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
  29. <property name="show_sql">true</property>
  30. <property name="hbm2ddl.auto">create</property>
  31. <property name="connection.release_mode">AFTER_TRANSACTION</property>
  32. <property name="connection.autocommit">true</property>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement