Guest User

Untitled

a guest
Oct 27th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <tomee>
  3. <!-- see http://tomee.apache.org/containers-and-resources.html -->
  4.  
  5. <!-- activate next line to be able to deploy applications in apps -->
  6. <!-- <Deployments dir="apps" /> -->
  7.  
  8. <!-- <Resource auth="Container" driverClassName="org.postgresql.Driver" global="jdbc/MyPostgresDB" name="jdbc/MyPostgresDB" password="postgres" type="javax.sql.DataSource" url="jdbc:postgresql://127.0.0.1:5432/Hibernate" username="postgres"/> -->
  9.  
  10. <Resource id="PostgresDbDs" type="javax.sql.DataSource">
  11. # PostgreSQL connection
  12. jdbcDriver=org.postgresql.Driver
  13. jdbcUrl=jdbc:postgresql://127.0.0.1:5432/Hibernate
  14. userName=postgres
  15. password=postgres
  16. jtaManaged=true
  17. </Resource>
  18.  
  19. </tomee>
  20.  
  21. Connection conn = dataSource.getConnection();
  22. Statement st = conn.createStatement();
  23.  
  24. Cannot create JDBC driver of class '' for connect URL 'null'
  25.  
  26. <?xml version="1.0" encoding="UTF-8"?>
  27. <persistence version="2.1"
  28. xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  29. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  30. <persistence-unit name="movie-unit" transaction-type="JTA">
  31. <!-- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> -->
  32. <jta-data-source>PostgresDbDs</jta-data-source>
  33. <non-jta-data-source>PostgresDbDsNotManagingBhai</non-jta-data-source>
  34. <class>org.ap.poc.ejb.Movie</class>
  35. <properties>
  36. <!-- <property name="eclipselink.ddl-generation" value="create-tables"
  37. /> <property name="eclipselink.ddl-generation.output-mode" value="database"
  38. /> <property name="eclipselink.logging.level" value="FINE" /> -->
  39. </properties>
  40. </persistence-unit>
  41. </persistence>
Add Comment
Please, Sign In to add comment