Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Properties
- hibernate.connection.username = postgres
- hibernate.connection.password = 12345
- hibernate.connection.datasource = org.postgresql.ds.PGSimpleDataSource
- hibernate.connection.driver_class= org.postgresql.Driver
- hibernate.connection.url= jdbc:postgresql://localhost:5432/final_project
- hibernate.hbm2ddl.auto = create
- hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
- hibernate.default_schema = public
- ---
- HibernateConfig
- ---
- package org.itstep.config;
- import java.util.Properties;
- import javax.websocket.Session;
- import org.hibernate.SessionFactory;
- import org.hibernate.cfg.Configuration;
- public class HibernateConfig {
- Configuration cfg = new Configuration().setProperties(new Properties());
- SessionFactory sessions = cfg.buildSessionFactory();
- Session session = (Session) sessions.openSession();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement