Guest User

Untitled

a guest
Sep 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. protected void setupPdb1() {
  2. final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
  3. .configure("hibernate-1.cfg.xml") // configures settings from hibernate.cfg.xml
  4. .build();
  5. try {
  6. sessionFactory1 = new MetadataSources(registry).buildMetadata().buildSessionFactory();
  7. } catch (Exception ex) {
  8. StandardServiceRegistryBuilder.destroy(registry);
  9. throw new RuntimeException(ex);
  10. }
  11. }
  12.  
  13. <?xml version="1.0" encoding="utf-8"?>
  14. <!DOCTYPE hibernate-configuration PUBLIC
  15. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  16. "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
  17. <hibernate-configuration>
  18. <session-factory>
  19.  
  20. <property name="connection.url">jdbc:oracle:thin:@//localhost:1521/pdb1.oradev.oraclecorp.com</property>
  21. <property name="connection.username">test</property>
  22. <property name="connection.password">password12</property>
  23. <property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
  24. <property name="dialect">org.hibernate.dialect.Oracle12cDialect</property>
  25.  
  26. <property name="show_sql">true</property>
  27.  
  28. <property name="format_sql">true</property>
  29. <property name="hbm2ddl.auto">create</property>
  30.  
  31. <!-- JDBC connection pool (use the built-in) -->
  32. <property name="connection.pool_size">1</property>
  33. <property name="current_session_context_class">thread</property>
  34.  
  35. <mapping class="net.codejava.hibernate.Book" />
  36.  
  37. </session-factory>
  38. </hibernate-configuration>
Add Comment
Please, Sign In to add comment