The following JDBC driver and database combinations have been tested and are supported for container-managed persistence:
IBM DB2 Database Type 2 Sun GlassFish/DataDirect JDBC Driver
Microsoft SQL Server Database Type 4 Sun GlassFish/DataDirect JDBC Driver
MySQL Server Database Type 4 Sun GlassFish/DataDirect JDBC Driver
To see the most current list of supported JDBC drivers, refer to the Sun GlassFish Enterprise Server v3 Release Notes.
The JAR file for the Sun driver is smdb2.jar; the JAR file for DataDirect driver is db2.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DB2
DataSource Classname: com.sun.sql.jdbcx.db2.DB2DataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.db2.DB2DataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
The JAR files for the DB2 driver are db2jcc.jar, db2jcc_license_cu.jar, and db2java.zip. Set your environment variables . For example:
LD_LIBRARY_PATH=/usr/db2user/sqllib/lib:${Java EE.home}/lib DB2DIR=/opt/IBM/db2/V8.2 DB2INSTANCE=db2user INSTHOME=/usr/db2user VWSPATH=/usr/db2user/sqllib THREADS_FLAG=native
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: DB2
DataSource Classname: com.ibm.db2.jcc.DB2SimpleDataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.db2.DB2DataSource
Properties:
databaseName - Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
driverType – Set to 2.
deferPrepares – Set to false.
The JAR file for the Java DB driver is derbyclient.jar. (Java DB is based upon Apache Derby.) Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Java DB
DataSource Classname: Specify one of the following:
org.apache.derby.jdbc.ClientDataSource org.apache.derby.jdbc.ClientXADataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server if it is different from the default.
databaseName – Specify the name of the database.
user - Specify the database user.
This is only necessary if Java DB is configured to use authentication. Java DB does not use authentication by default. When the user is provided, it is the name of the schema where the tables reside.
password – Specify the database password.
This is only necessary if Java DB is configured to use authentication.
The JAR file for the Sun driver is smsqlserver.jar; the JAR file for the DataDirect driver is sqlserver.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Microsoft SQL Server
DataSource Classname: com.sun.sql.jdbcx.sqlserver.SQLServerDataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.sqlserver.SQLServerDataSource
Properties:
serverName – Specify the host name or IP address and the port of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
selectMethod – Set to cursor.
The Sun MySQL driver only works with MySQL Enterprise. The JAR file for the Sun driver is smmysql.jar; the JAR file for the DataDirect driver is mysql.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: MySQL Server
DataSource Classname: com.sun.sql.jdbcx.mysql.MySQLDataSource
DataDirect DataSource: com.ddtek.jdbcx.mysql.MySQLDataSource
Properties:
serverName – Specify the host name or IP address and the port of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
selectMethod – Set to cursor.
The JAR file for the MySQLTM driver is mysql-connector-java-5.1.7-bin.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Microsoft SQL Server
DataSource Classname:
com.mysql.jdbc.jdbc2.optional.MysqlDataSource com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the Sun driver is smoracle.jar; the JAR file for the DataDirect driver is oracle.jar.
To make the Oracle driver behave in a Java EE-compliant manner, you must set this system property as true: oracle.jdbc.J2EE13Compliant=true.
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Oracle
DataSource Classname: com.sun.sql.jdbcx.oracle.OracleDataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.oracle.OracleDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the OCI Oracle driver is ojdbc14.jar. Make sure that the shared library is available through LD_LIBRARY_PATH and that the ORACLE_HOME property is set. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Oracle
DataSource Classname: Specify one of the following:
oracle.jdbc.pool.OracleDataSource oracle.jdbc.xa.client.OracleXADataSource
Properties:
user – Set as appropriate.
password – Set as appropriate.
xa-driver-does-not-support-non-tx-operations - Set to the value true. Only needed if both non-XA and XA connections are retrieved from the same connection pool. Might degrade performance.
As an alternative to setting this property, you can create two connection pools, one for non-XA connections and one for XA connections.
The JAR file for the Oracle driver is ojdbc6.jar.
When using this driver, keep in mind that you cannot insert more than 2000 bytes of data into a column. To circumvent this problem, use the OCI driver (JDBC type 2).
To make the Oracle driver behave in a Java EE-compliant manner, you must set this system property as true: oracle.jdbc.J2EE13Compliant=true.
Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Oracle
DataSource Classname: Specify one of the following:
oracle.jdbc.pool.OracleDataSource oracle.jdbc.xa.client.OracleXADataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.oracle.OracleDataSource
Properties:
user – Set as appropriate.
password – Set as appropriate.
xa-driver-does-not-support-non-tx-operations - Set to the value true. Optional: only needed if both non-XA and XA connections are retrieved from the same connection pool. Might degrade performance.
As an alternative to setting this property, you can create two connection pools, one for non-XA connections and one for XA connections.
For the Oracle thin driver, the XAResource.recover method repeatedly returns the same set of in-doubt Xids regardless of the input flag. According to the XA specifications, the Transaction Manager initially calls this method with TMSTARTSCAN and then with TMNOFLAGS repeatedly until no Xids are returned. The XAResource.commit method also has some issues.
To disable this Enterprise Server workaround, the oracle-xa-recovery-workaround property value must be set to false.
The JAR file for the PostgreSQL driver is postgresql-8.4-701.jdbc4.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: PostgreSQL Server
DataSource Classname: org.postgresql.ds.PGSimpleDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
The JAR file for the Sun driver is smsybase.jar; the JAR file for the DataDirect driver is sybase.jar. Configure the connection pool using the following settings:
Name: Use this name when you configure the JDBC resource later.
Resource Type: Specify the appropriate value.
Database Vendor: Sybase
DataSource Classname: com.sun.sql.jdbcx.sybase.SybaseDataSource
DataDirect DataSource Classname: com.ddtek.jdbcx.sybase.SybaseDataSource
Properties:
serverName – Specify the host name or IP address of the database server.
portNumber – Specify the port number of the database server.
databaseName – Set as appropriate. This is optional.
user – Set as appropriate.
password – Set as appropriate.