JPA - Open JPA

> JPA - Java Persistence API (JPA)

2 - Configuration

2.1 - Provider

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
Advertising

2.2 - Properties

Persistence Properties:

<properties>
  <property name="openjpa.ConnectionURL" value="jdbc:mysql://xx.xx.xx.xx:3306/dbname"/>
  <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
  <property name="openjpa.ConnectionUserName" value="xxx"/>
  <property name="openjpa.ConnectionPassword" value="xxx"/>
  <property name="openjpa.Log" value="SQL=TRACE"/>
</properties>
  • Dynamically
Map propertiesMap = new HashMap();
propertiesMap.put("openjpa.ConnectionUserName", "sh");
propertiesMap.put("openjpa.ConnectionPassword", "sh");
propertiesMap.put("openjpa.ConnectionDriverName","oracle.jdbc.OracleDriver");
propertiesMap.put("openjpa.ConnectionUserName","jdbc:oracle:thin:@localhost:1521/pdborcl.hotitem.local");
propertiesMap.put("openjpa.Log", "DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE");
jpa/openjpa.txt · Last modified: 2014/01/06 16:47 by gerardnico