Advertisement
ArmoredStone

Untitled

Sep 15th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Properties
  2.  
  3. hibernate.connection.username = postgres
  4. hibernate.connection.password = 12345
  5. hibernate.connection.datasource = org.postgresql.ds.PGSimpleDataSource
  6. hibernate.connection.driver_class= org.postgresql.Driver
  7. hibernate.connection.url= jdbc:postgresql://localhost:5432/final_project
  8. hibernate.hbm2ddl.auto = create
  9. hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
  10. hibernate.default_schema = public
  11.  
  12. ---
  13.  
  14. HibernateConfig
  15.  
  16. ---
  17.  
  18. package org.itstep.config;
  19.  
  20.  
  21.  
  22. import java.util.Properties;
  23.  
  24. import javax.websocket.Session;
  25.  
  26. import org.hibernate.SessionFactory;
  27. import org.hibernate.cfg.Configuration;
  28.  
  29. public class HibernateConfig {
  30. Configuration cfg = new Configuration().setProperties(new Properties());
  31. SessionFactory sessions = cfg.buildSessionFactory();
  32. Session session = (Session) sessions.openSession();
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement