Sun GlassFish Enterprise Server v3 Administration Guide

Configuration Specifics for JDBC Drivers

Enterprise Server is designed to support connectivity to any database management system by using a corresponding JDBC driver.

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:

JDBC Drivers, Limited Support

The following JDBC drivers can also be used with Enterprise Server, but have not been fully tested. Although Sun offers no product support for these drivers, Sun does offer limited support for the use of these drivers with Enterprise Server:


Note –

An Oracle database user running the capture-schema command needs ANALYZE ANY TABLE privileges if that user does not own the schema. These privileges are granted to the user by the database administrator. For information about capture-schema, see Sun GlassFish Enterprise Server v3 Reference Manual.


IBM Informix Type 4 Driver for Sun/DataDirect

Configure the connection pool using the following settings:

Inet Oraxo JDBC Driver for Oracle Databases

The JAR file for the Inet Oracle driver is Oranxo.jar. Configure the connection pool using the following settings:

Inet Merlia JDBC Driver for Microsoft SQL Server Databases

The JAR file for the Inet Microsoft SQL Server driver is Merlia.jar. Configure the connection pool using the following settings:

Inet Sybelux JDBC Driver for Sybase Databases

The JAR file for the Inet Sybase driver is Sybelux.jar. Configure the connection pool using the following settings:

JConnect Type 4 Driver for Sybase ASE 12.5 Databases

The JAR file for the Sybase driver is jconn4.jar. Configure the connection pool using the following settings: