Guest User

Untitled

a guest
Nov 30th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE hibernate-configuration PUBLIC
  3. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  4. "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  5.  
  6. <hibernate-configuration>
  7.  
  8. <session-factory>
  9.  
  10. <property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
  11. <property name="connection.url">jdbc:mysql://localhost/dbFatura?useTimezone=true&serverTimezone=UTC</property>
  12. <property name="connection.username">root</property>
  13. <property name="connection.password">root</property>
  14. <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
  15. <property name="connection.pool_size">1</property>
  16. <property name="current_session_context_class">thread</property>
  17. <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
  18. <property name="show_sql">true</property>
  19. <property name="hbm2ddl.auto">update</property>
  20.  
  21. <!-- <mapping resource="org/hibernate/tutorial/domain/Fatura.hbm.xml"/> -->
  22. <mapping class="org.hibernate.tutorial.domain.Fatura"/>
  23.  
  24. </session-factory>
  25.  
  26. </hibernate-configuration>
  27.  
  28. private static SessionFactory buildSessionFactory() {
  29. try{
  30. return new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
  31. } catch (Throwable ex) {
  32. System.err.println("Initial SessionFactory creation factory failed. " + ex);
  33. throw new ExceptionInInitializerError(ex);
  34. }
  35. }
  36.  
  37. <property name="connection.url">jdbc:mysql://localhost/dbFatura?useTimezone=true&serverTimezone=UTC</property>
Add Comment
Please, Sign In to add comment