Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: Creating Applications That Use the JDBC API
- Next: Chapter 12 Using the Transaction Service

# Configurations for Specific JDBC Drivers

Application Server 8.1 is designed to support connectivity to any database management system with a corresponding JDBC driver. The following JDBC driver and database combinations are supported. These combinations have been tested with Application Server 8.1 and are found to be J2EE compatible. They are also supported for CMP.

- PointBase Type 4 Driver

- Sun Java System JDBC Driver for DB2 Databases

- Sun Java System JDBC Driver for Oracle 8.1.7 and 9.x Databases

- Sun Java System JDBC Driver for Microsoft SQL Server Databases

- Sun Java System JDBC Driver for Sybase Databases

- IBM DB2 8.1 Type 2 Driver

- JConnect Type 4 Driver for Sybase ASE 12.5 Databases

For an up to date list of currently supported JDBC drivers, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Release Notes.

Other JDBC drivers can be used with Application Server 8.1, but J2EE compliance tests have not been completed with these drivers. Although Sun offers no product support for these drivers, Sun offers limited support of the use of these drivers with Application Server 8.1.

- Inet Oraxo JDBC Driver for Oracle 8.1.7 and 9.x Databases

- Inet Merlia JDBC Driver for Microsoft SQL Server Databases

- Inet Sybelux JDBC Driver for Sybase Databases

- Oracle Thin Type 4 Driver for Oracle 8.1.7 and 9.x Databases

- OCI Oracle Type 2 Driver for Oracle 8.1.7 and 9.x Databases

- IBM Informix Type 4 Driver

- MM MySQL Type 4 Driver

- CloudScape 5.1 Type 4 Driver

For details about how to integrate a JDBC driver and how to use the Administration Console or the command line interface to implement the configuration, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide.

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 Using the capture-schema Utility.

## PointBase Type 4 Driver

The PointBase JDBC driver is included with the Application Server by default, except for the Solaris bundled installation, which does not include PointBase. Therefore, unless you have the Solaris bundled installation, you do not need to integrate this JDBC driver with the Application Server.

PointBase is intended for evaluation use only, not for production or deployment use.

The JAR file for the PointBase driver is `pbclient.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: `PointBase`

- DataSource Classname:Specify one of the following:

      com.pointbase.jdbc.jdbcDataSource
      com.pointbase.xa.xaDataSource

- Properties:

  - `user` - Specify the database user.

  - `password` - Specify the database password.

  - `databaseName` - Specify the URL of the database. The syntax is as follows:

        jdbc:pointbase:server://server:port/dbname,new

## Sun Java System JDBC Driver for DB2 Databases

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

## Sun Java System JDBC Driver for Oracle 8.1.7 and 9.x Databases

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`]`

## Sun Java System JDBC Driver for Microsoft SQL Server Databases

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: `mssql`

- 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`]`

## Sun Java System JDBC Driver for Sybase Databases

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`]`

## IBM DB2 8.1 Type 2 Driver

The JAR files for the DB2 driver are `db2jcc.jar`, `db2jcc_license_cu.jar`, and `db2java.zip`. Set environment variables as follows:

    LD_LIBRARY_PATH=/usr/db2user/sqllib/lib:${j2ee.home}/lib
    DB2DIR=/opt/IBM/db2/V8.1
    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:

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

  - `databaseName` - Set as appropriate.

  - `driverType` - Set to `2`.

  - `deferPrepares` - Set to `false`.

## JConnect Type 4 Driver for Sybase ASE 12.5 Databases

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.

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

  - `databaseName` - Set as appropriate. Do not specify the complete URL, only the database name.

  - `BE_AS_JDBC_COMPLIANT_AS_POSSIBLE` - Set to `true`.

  - `FAKE_METADATA` - Set to `true`.

## Inet Oraxo JDBC Driver for Oracle 8.1.7 and 9.x Databases

The JAR file for the Inet Oracle driver is `Oranxo.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.inet.ora.OraDataSource`

- Properties:

  - `user` - Specify the database user.

  - `password` - Specify the database password.

  - `serviceName` - Specify the URL of the database. The syntax is as follows:

        jdbc:inetora:server:port:dbname

    For example:

        jdbc:inetora:localhost:1521:payrolldb

    In this example,`localhost` is the host name of the machine running the Oracle server, `1521` is the Oracle server’s port number, and `payrolldb` is the SID of the database. For more information about the syntax of the database URL, see the Oracle documentation.

  - `serverName` - Specify the host name or IP address of the database server.

  - `port` - Specify the port number of the database server.

  - `streamstolob` - If the size of BLOB or CLOB data types exceeds 4 KB and this driver is used for CMP, this property must be set to `true`.

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

## 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:

- Name: Use this name when you configure the JDBC resource later.

- Resource Type: Specify the appropriate value.

- Database Vendor: `mssql`

- DataSource Classname: `com.inet.tds.TdsDataSource`

- Properties:

  - `serverName` - Specify the host name or IP address and the port of the database server.

  - `port` - Specify the port number of the database server.

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

## 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:

- Name: Use this name when you configure the JDBC resource later.

- Resource Type: Specify the appropriate value.

- Database Vendor: `Sybase`

- DataSource Classname: `com.inet.syb.SybDataSource`

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

  - `databaseName` - Set as appropriate. Do not specify the complete URL, only the database name.

## Oracle Thin Type 4 Driver for Oracle 8.1.7 and 9.x Databases

The JAR file for the Oracle driver is `ojdbc14.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:Specify one of the following:

      oracle.jdbc.pool.OracleDataSource
      oracle.jdbc.xa.client.OracleXADataSource

- Properties:

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

  - `URL` - Specify the complete database URL using the following syntax:

        jdbc:oracle:thin:[user/password]@host[:port]/service

    For example:

        jdbc:oracle:thin:@localhost:1521:customer_db

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

  Note –

  You must set the `oracle-xa-recovery-workaround` property in the Transaction Service for recovery of global transactions to work correctly. For details, see Transaction Scope.

  When using this driver, it is not possible to insert more than 2000 bytes of data into a column. To circumvent this problem, use the OCI driver (JDBC type 2).

## OCI Oracle Type 2 Driver for Oracle 8.1.7 and 9.x 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:

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

  - `URL` - Specify the complete database URL using the following syntax:

        jdbc:oracle:oci:[user/password]@host[:port]/service

    For example:

        jdbc:oracle:oci:@localhost:1521:customer_db

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

## IBM Informix Type 4 Driver

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: `Informix`

- DataSource Classname:Specify one of the following:

      com.informix.jdbcx.IfxDataSource
      com.informix.jdbcx.IfxXADataSource

- Properties:

  - `serverName` - Specify the Informix database server name.

  - `portNumber` - Specify the port number of the database server.

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

  - `databaseName` - Set as appropriate. This is optional.

  - `IfxIFXHost` - Specify the host name or IP address of the database server.

## MM MySQL Type 4 Driver

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`

- DataSource Classname: one of the following:

      com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
      com.mysql.jdbc.jdbc2.optional.MysqlXaConnectionPoolDataSource

- Properties:

  - `serverName` - Specify the host name or IP address of the database server.

  - `port` - Specify the port number of the database server.

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

  - `databaseName` - 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"

## CloudScape 5.1 Type 4 Driver

The JAR files for the CloudScape driver are `db2j.jar`, `db2jtools.jar`, `db2jcview.jar`, `jh.jar`, `db2jcc.jar`, and `db2jnet.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: `Cloudscape`

- DataSource Classname: `com.ibm.db2.jcc.DB2DataSource`

- Properties:

  - `user` - Set as appropriate.

  - `password` - Set as appropriate.

  - `databaseName` - Set as appropriate.

- Previous: Creating Applications That Use the JDBC API
- Next: Chapter 12 Using the Transaction Service

- © 2010, Oracle Corporation and/or its affiliates