Database-specific administrative tasks for JDBC applications<?Pub Caret>

Database-specific administrative tasks for JDBC applications

This article provides miscellaneous tips for using supported databases. See also the related links.

Always consult the product documentation for a list of the database brands and versions that are supported by your particular WebSphere Application Server version, edition, and FixPak.

Notes about various databases

Additional administrative tasks for specific databases

For your convenience, this article provides instructions for enabling some popular database drivers, and performing other administrative tasks often required to provide data access to applications running on WebSphere Application Server. These tasks are performed outside of the WebSphere Application Server administrative tools, often using the database product tools. Always refer to the documentation accompanying your database driver as the authoritative and complete source of driver information.

See the Supported hardware, software, and APIs for the latest information about supported databases, drivers, and operating systems.

Enabling JDBC 2.0

Ensure that your operating system environment is set up to support JDBC 2.0. This action is required to use data sources created through WebSphere Application Server.

The following steps make it possible to find the appropriate JDBC 2.0 driver for use with WebSphere Application Server administration:

Enabling JDBC 2.0 with DB2 on Windows NT systems

To enable JDBC 2.0 use on Windows NT systems:

Perform the steps once for each system.

Determining the level of the JDBC API in use for DB2 on Windows NT systems

To determine the JDBC level in use on your system:

Enabling JDBC 2.0 with DB2 on UNIX systems

Determining the level of the JDBC API in use for DB2 on UNIX systems

Sourcing the db2profile script on UNIX systems

Before starting WebSphere Application Server to host applications requiring data access, source the db2profile:

. ~db2inst1/sqllib/db2profile

where db2inst1 is the user created during DB2 installation.

Using Java Transaction API drivers

Instructions are available for using Java Transaction API (JTA) drivers on particular operating systems. See your operating system documentation for more information.

The goal of this section is to provide information about the steps that make DB2 work well with applications utilizing XA classes -- that is, those whose dataSourceClasses implement javax.sql.XADataSource .

Using Java Transaction API drivers for DB2 on Windows NT systems

To enable JTA drivers for DB2 on Windows NT systems, follow these steps:

  1. Bind the necessary packages to the database. From the DB2 Command Line Processor window, issue the following commands:
    db2=> connect to 
    mydb2jta
    db2=> bind db2home\bnd\@db2cli.lst db2=> bind db2home\bnd\@db2ubind.lst db2=> disconnect mydb2jta

    where mydb2jta is the name of the database to enable for the JTA, and db2home is the DB2 root installation directory path (for example, D:\ProgramFiles\SQLLIB\bnd\@db2cli.lst ).

  2. Specify the following settings when you use an IBM WebSphere Application Server administrative client (such as the administrative console) to configure a JDBC driver:

    • Server class path = %DB2_ROOT%/Sqllib/java/db2java.zip

    • Implementation class name = COM.ibm.db2.jdbc.DB2XADataSource

Using Java Transaction API drivers for DB2 on UNIX systems

To enable JTA drivers on UNIX systems, follow these steps:

  1. Stop all DB2 services.

  2. Stop the IBM WebSphere Application Server administrative service.

  3. Stop any other processes that use the db2java.zip file.

  4. Make sure that you already enabled JDBC 2.0.

  5. Start the DB2 services.

  6. Bind the necessary packages to the database. From the DB2 command-line process or window, issue the following commands:
    db2=> connect to mydb2jta db2=> bind db2home\bnd\@db2cli.lst db2=> bind db2home\bnd\@db2ubind.lst db2=> disconnect mydb2jta 

  7. Specify the following settings when you use an IBM WebSphere Application Server administrative client (such as the administrative console) to configure a JDBC driver:

    • Server class path = $INSTHOME/sqllib/java12/db2java.zip

      For example, if $INSTHOME is /home/test, the path will be /home/test/sqllib/java12/db2java.zip

    • Implementation class name = COM.ibm.db2.jdbc.DB2XADataSource

For Oracle 8.1.7 two phase commit support

You can use the Oracle 8.1.7 thin driver for JTA two-phase support with the following restrictions:

Using Java Transaction API drivers for Sybase products on AIX systems

To enable Java Transaction API (JTA) drivers for use with Sybase products on the AIX operating system, follow these steps:

  1. Enable the Data Transaction Manager (DTM) by issuing these commands (one per line) at a command prompt:
        isql -Usa -Ppassword -Sservername     sp_configure "enable DTM", 1
        go

  2. Stop the Sybase Adaptive Server database and start it again.

  3. Grant the appropriate role authorization to the enterprise bean user at a command prompt:
        isql -Usa -Ppassword -Sservername     grant role dtm_tm_role to EJB           
        go

Notes about Sybase Java Transaction API drivers

Do not use a Sybase Java Transaction API (JTA) connection in an enterprise bean method with an unspecified
transaction context. A Sybase JTA connection does not support the local transaction mode. The implication is that use the Sybase JTA connection in a global transaction context.


Related concepts
Data sources

Related reference
Vendor-specific data sources minimum required settings
Data access: Resources for