![]() | ![]() |
![]() |
| Project | Ver 1.1 | Ver 1.2 | JDO | JPA | Guides | Tools |
| 1.1 | Preparation | O/R Mapping | Runtime | Extensions | Developer |
JPOX supports persisting objects to RDBMS datastores. It supports the vast majority of RDBMS products available today. JPOX communicates with the RDBMS datastore using JDBC. RDBMS systems accept varying standards of SQL and so JPOX will support particular RDBMS/JDBC combinations only, though clearly we try to support as many as possible. By default when you create a PersistenceManagerFactory (PMF) to connect to a particular datastore JPOX will automatically detect the datastore adapter to use and will use its own internal adapter for that type of datastore. If you find that either JPOX has incorrectly detected the adapter to use, or that there is some issue with the internal adapter, you can override the default behaviour. Please refer to the Database Adapter Extension Guide for details. The table below shows the versions of RDBMS and JDBC driver that JPOX has been tested with
If you have success with any other combinations for the above RDBMS or indeed with any other RDBMS, please let us know so we can update our compatibility guide. We only show here what we have either tried ourselves or what has been reported as successful.
To specify DB2 as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=COM.ibm.db2.jdbc.app.DB2Driver
javax.jdo.option.ConnectionURL=jdbc:db2:'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
#DB2network driver
#javax.jdo.option.ConnectionDriverName=COM.ibm.db2.jdbc.net.DB2Driver
#javax.jdo.option.ConnectionURL=jdbc:db2://hostname:port//dbname
MySQL is supported as an RDBMS datastore by JPOX with the following provisos
To specify MySQL as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://'host':'port'/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
MS SQL Server is supported as an RDBMS datastore by JPOX with the following proviso
To specify MS SQL as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=com.microsoft.jdbc.sqlserver.SQLServerDriver
javax.jdo.option.ConnectionURL=jdbc:microsoft:sqlserver://'host':'port';DatabaseName='db-name';SelectMethod=cursor
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
To specify Oracle as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc) ... you can also use 'oci' instead of 'thin' depending on your driver.
javax.jdo.option.ConnectionDriverName=oracle.jdbc.driver.OracleDriver
javax.jdo.option.ConnectionURL=jdbc:oracle:thin:@'host':'port':'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
To specify Sybase as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=com.sybase.jdbc2.jdbc.SybDriver
javax.jdo.option.ConnectionURL=jdbc:sybase:Tds:'host':'port'/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
HSQLDB is supported as an RDBMS datastore by JPOX with the following proviso
To specify HSQL as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
javax.jdo.option.ConnectionURL=jdbc:hsqldb:hsql://'host':'port'/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
H2 is supported as an RDBMS datastore by JPOX To specify H2 as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=org.h2.Driver
javax.jdo.option.ConnectionURL=jdbc:h2:'db-name'
javax.jdo.option.ConnectionUserName=sa
javax.jdo.option.ConnectionPassword=
McKoi is supported as an RDBMS datastore by JPOX with the following proviso
To specify McKoi as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=com.mckoi.JDBCDriver
javax.jdo.option.ConnectionURL=jdbc:mckoi://'host':'port'/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
To specify PostgreSQL as your datastore, you will need something like the following specifying (replacing 'db-name' with name of your database etc)
javax.jdo.option.ConnectionDriverName=org.postgresql.Driver
javax.jdo.option.ConnectionURL=jdbc:postgresql://'host':'port'/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
Apache Derby is supported as an RDBMS datastore by JPOX To specify Apache Derby/Cloudscape as your datastore, you will need something like the following specifying (replacing 'db-name' with filename of your database etc)
javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver
javax.jdo.option.ConnectionURL=jdbc:derby:'db-name';create=true
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
ASCII: Derby 10.1 does not have a function to convert a char into ascii code. JPOX needs such function to converts chars to int values when performing queries converting chars to ints. JPOX defines a user defined function, JPOX_ASCII, which is automatically created on startup. The SQL for the UDF function is: DROP FUNCTION JPOX_ASCII; CREATE FUNCTION JPOX_ASCII(C CHAR(1)) RETURNS INTEGER EXTERNAL NAME 'org.jpox.store.rdbms.adapter.DerbySQLFunction.ascii' CALLED ON NULL INPUT LANGUAGE JAVA PARAMETER STYLE JAVA; String.matches(pattern): When pattern argument is a column, JPOX defines a function that allows Derby 10.1 to perform the matches function. The SQL for the UDF function is: DROP FUNCTION JPOX_MATCHES; CREATE FUNCTION JPOX_MATCHES(TEXT VARCHAR(8000), PATTERN VARCHAR(8000)) RETURNS INTEGER EXTERNAL NAME 'org.jpox.store.rdbms.adapter.DerbySQLFunction.matches' CALLED ON NULL INPUT LANGUAGE JAVA PARAMETER STYLE JAVA;
Firebird is supported as an RDBMS datastore by JPOX with the proviso that
To specify Firebird as your datastore, you will need something like the following specifying (replacing 'db-name' with filename of your database etc)
javax.jdo.option.ConnectionDriverName=org.firebirdsql.jdbc.FBDriver
javax.jdo.option.ConnectionURL=jdbc:firebirdsql://localhost/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
To specify SAPDB/MaxDB as your datastore, you will need something like the following specifying (replacing 'db-name' with filename of your database etc)
javax.jdo.option.ConnectionDriverName=com.sap.dbtech.jdbc.DriverSapDB
javax.jdo.option.ConnectionURL=jdbc:sapdb://localhost/'db-name'
javax.jdo.option.ConnectionUserName='user-name'
javax.jdo.option.ConnectionPassword='password'
If you need to pass additional parameters to the JDBC driver you can append these to the end of the javax.jdo.option.ConnectionURL. For example, javax.jdo.option.ConnectionURL=jdbc:mysql://localhost?useUnicode=true&characterEncoding=UTF-8 |