The following JDBC driver and database combinations have been tested and are supported for container-managed persistence:
Sun GlassFish JDBC Driver for Oracle 8.1.7 and 9.x Databases
Sun GlassFish JDBC Driver for Microsoft SQL Server Databases
To see the most current list of supported JDBC drivers, refer to the Sun GlassFish Enterprise Server v3 Prelude Release Notes.
The JAR files for this driver are smbase.jar, smdb2.jar, and smutil.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
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.
URL: jdbc:sun:db2://serverName:portNumber;databaseName=databaseName
The JAR files for this driver are smbase.jar, smoracle.jar, and smutil.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: Oracle
DataSource Classname: com.sun.sql.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.
SID – Set as appropriate.
user – Set as appropriate.
password – Set as appropriate.
URL: jdbc:sun:oracle://serverName[:portNumber][;SID=databaseName]
The JAR files for this driver are smbase.jar, smsqlserver.jar, and smutil.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
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.
URL: jdbc:sun:sqlserver://serverName[:portNumber]
The JAR files for this driver are smbase.jar, smsybase.jar, and smutil.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
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.
URL: jdbc:sun:sybase://serverName[:portNumber]
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:${j2ee.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
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/Derby 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/Derby
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 Derby is configured to use authentication. Derby 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/Derby is configured to use authentication.
URL: jdbc:derby://serverName:portNumber/databaseName;create=true
Include the ;create=true part only if you want the database to be created if it does not exist.
The JAR file for the Sybase driver is jconn2.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: Specify one of the following:
com.sybase.jdbc2.jdbc.SybDataSource com.sybase.jdbc2.jdbc.SybXADataSource
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. Do not specify the complete URL, only the database name.
user – Set as appropriate.
password – Set as appropriate.
BE_AS_JDBC_COMPLIANT_AS_POSSIBLE – Set to true.
FAKE_METADATA – Set to true.
The JAR file for the MySQL driver is mysql-connector-java-version-bin-g.jar, for example, mysql-connector-java-3.1.12-bin-g.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: Specify one of the following:
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
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.
URL – If you are using global transactions, you can set this property instead of serverName, port, and databaseName.
The MM MySQL Type 4 driver doesn’t provide a method to set the required relaxAutoCommit property, so you must set it indirectly by setting the URL property:
jdbc:mysql://host:port/database?relaxAutoCommit="true"