Sun GlassFish Enterprise Server v3 Administration Guide

JDBC Drivers, Full Support

The following JDBC driver and database combinations have been tested and are supported for container-managed persistence:

To see the most current list of supported JDBC drivers, refer to the Sun GlassFish Enterprise Server v3 Release Notes.

IBM DB2 Database Type 2 Sun GlassFish/DataDirect JDBC Driver

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:

IBM DB2 Database Type 2 JDBC Driver

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:

Java DB/Derby Type 4 JDBC Driver

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:

Microsoft SQL Server Database Type 4 Sun GlassFish/DataDirect JDBC Driver

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:

MySQL Server Database Type 4 Sun GlassFish/DataDirect JDBC Driver

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:

MySQL Server Database Type 4 JDBC Driver

The JAR file for the MySQLTM driver is mysql-connector-java-5.1.7-bin.jar. Configure the connection pool using the following settings:

Oracle 11 Database Sun/DataDirect JDBC Driver

The JAR file for the Sun driver is smoracle.jar; the JAR file for the DataDirect driver is oracle.jar.


Note –

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:

Oracle OCI Type 2 Driver for Oracle Databases

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:

Oracle 11 Database Thin Type 4 JDBC Driver

The JAR file for the Oracle driver is ojdbc6.jar.


Note –

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).



Note –

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:

PostgreSQL Type 4 JDBC Driver

The JAR file for the PostgreSQL driver is postgresql-8.4-701.jdbc4.jar. Configure the connection pool using the following settings:

Sybase Database Type 4 Sun GlassFish/DataDirect JDBC Driver

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: