Guest User

Untitled

a guest
Mar 26th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <!-- Параметры коннекта -->
  2. <property name="connection.driver_class">org.postgresql.Driver</property>
  3. <!--
  4. <property name="connection.url">jdbc:postgresql://192.168.1.63/test</property>
  5. <property name="connection.username">postgres</property>
  6. <property name="connection.password">postgres</property>
  7. -->
  8. <property name="connection.verifyServerCertificate">false</property>
  9. <property name="connection.requireSSL">false</property>
  10. <property name="connection.useSSL">false</property>
  11. <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
  12. <property name="hibernate.c3p0.min_size">5</property>... + маппинги
  13.  
  14. private static SessionFactory sessionFactory = null;
  15.  
  16. static {
  17. Configuration cfg = new Configuration().configure()
  18. .setProperty("connection.url", "jdbc:postgresql://192.168.1.63/test")
  19. .setProperty("connection.username", "postgres")
  20. .setProperty("connection.password", "postgres");
  21.  
  22. sessionFactory = cfg.buildSessionFactory();
  23. }
  24.  
  25. public static SessionFactory getSessionFactory() {
  26. return sessionFactory;
  27. }
  28.  
  29. Configuration cfg = new Configuration().configure()
  30. .setProperty("hibernate.connection.url", "jdbc:postgresql://192.168.1.63/test")
  31. .setProperty("hibernate.connection.username", "postgres")
  32. .setProperty("hibernate.connection.password", "postgres");
Add Comment
Please, Sign In to add comment