Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void setupPdb1() {
- final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
- .configure("hibernate-1.cfg.xml") // configures settings from hibernate.cfg.xml
- .build();
- try {
- sessionFactory1 = new MetadataSources(registry).buildMetadata().buildSessionFactory();
- } catch (Exception ex) {
- StandardServiceRegistryBuilder.destroy(registry);
- throw new RuntimeException(ex);
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
- <hibernate-configuration>
- <session-factory>
- <property name="connection.url">jdbc:oracle:thin:@//localhost:1521/pdb1.oradev.oraclecorp.com</property>
- <property name="connection.username">test</property>
- <property name="connection.password">password12</property>
- <property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
- <property name="dialect">org.hibernate.dialect.Oracle12cDialect</property>
- <property name="show_sql">true</property>
- <property name="format_sql">true</property>
- <property name="hbm2ddl.auto">create</property>
- <!-- JDBC connection pool (use the built-in) -->
- <property name="connection.pool_size">1</property>
- <property name="current_session_context_class">thread</property>
- <mapping class="net.codejava.hibernate.Book" />
- </session-factory>
- </hibernate-configuration>
Add Comment
Please, Sign In to add comment