Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Student s1 = new Student();
- s1.setName("Monaj");
- s1.setRoll(1);
- s1.setDate(new Date());
- Configuration configuration = new Configuration().configure();
- serviceRegistry = new StandardServiceRegistryBuilder()
- .applySettings(configuration.getProperties()).build();
- sessionFactory = configuration.configure()
- .buildSessionFactory(serviceRegistry);
- Session session=sessionFactory.openSession();
- Transaction t1=session.beginTransaction();
- session.save(s1);
- t1.commit();
- session.close();
- 15:29:08.476 [main] DEBUG o.h.e.j.i.LogicalConnectionImpl - Aggressively releasing JDBC connection
- 15:29:08.476 [main] DEBUG o.h.e.j.i.LogicalConnectionImpl - Releasing JDBC connection
- 15:29:08.476 [main] DEBUG o.h.e.j.i.LogicalConnectionImpl - Released JDBC connection
- 15:29:08.477 [main] DEBUG o.h.e.j.internal.JdbcCoordinatorImpl - HHH000420: Closing un-released batch
- 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
- <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
- <property name="connection.url">jdbc:mysql://localhost/test</property>
- <property name="connection.password">password</property>
- <property name="connection.username">admin</property>
- <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
- <property name="show_sql">true</property>
- <property name="hbm2ddl.auto">create</property>
- <property name="connection.release_mode">AFTER_TRANSACTION</property>
- <property name="connection.autocommit">true</property>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement