InfoCenter Home >
1: Solution planning and skills overview >
1.2: Components in a WebSphere environment >
1.2.3: Planning and skills for databases >
1.2.3.6: Database drivers <- you are here

1.2.3.6: Database drivers

This section provides information on the drivers that are available for use with each database supported for use with IBM WebSphere Application Server. The following topics are included in this section:

Always refer to the documentation accompanying your database as the authoritative source of driver information. Refer to the WebSphere Application Server product prerequisites for the latest information about supported databases, drivers, and operating systems.

Database-related settings in WebSphere Application Server

Various product interfaces prompt you to enter database-related settings. These interfaces include the product installation, the database conversion assistant, and the administrative clients. In the following table, the first column lists the type of database-related settings to configure. The second column shows where to find help in identifying the appropriate values to be supplied for these settings.

Database-related setting Source for obtaining the appropriate value
Database driver path See the driver locations table
Other database driver settings, including the URL See article 6.6.14.1.4.1
Database user ID and password

Usually, the user ID must have administrative authority. Some databases, such as DB2, place an eight-character limit on the ID.

Consult the case-specific installation and configuration instructions for your operating system. To access them, click the appropriate operating system link on the Welcome page.

Data sources for obtaining database connections See article 6.6.14.1.4.2

Locating JDBC drivers on your operating system

The following table lists the default locations of JDBC driver files. See the product prerequisites for the most up-to-date information on the operating system brands and databases supported by IBM WebSphere Application Server. Column 1 in the table lists the operating system, and column 2 shows a list of the drivers that are available for use with each database supported for the operating system.

Operating system Drivers
AIX
HP-UX
Linux (Intel)
  • DB2: $DB2_HOME/java/db2java.zip
  • Oracle: $ORACLE_HOME/jdbc/lib/classes12.zip
  • InstantDB: product_installation_root/lib/idb.jar
Linux on S/390
NetWare
  • DB2: $DB2_HOME/lib/db2java.zip
  • Oracle: $ORACLE_HOME/jdbc/lib/classes12.zip
  • InstantDB: product_installation_root/lib/idb.jar
Solaris
Windows
  • DB2: C:\SQLLIB\java12\db2java.zip

    Use of JDBC2.0 with DB2 requires the user to run the command usejdbc2 in the C:\SQLLIB\java12 directory.

  • Oracle: C:\Oracle\Ora81\jdbc\lib\classes12.zip
  • InstantDB: product_installation_root/lib/idb.jar
  • Introduced in Version 3.5.3  Merant SequeLink:

Tips for selecting JDBC drivers

Here are some tips for selecting JDBC drivers:

  • For DB2, consider type 2 application drivers, which are typically faster than type 2 network drivers.
  • DB2 6.1 on HPUX does not support JDBC 2.0.
  • For Sybase, consider type 4 thin drivers.
  • On Sybase, JDBC 2.0 support is provided by the jConnect 5.2 component
  • For Oracle, consider type 4 thin drivers.
  • The InstantDB driver is provided with WebSphere Application Server
  • Type 2 drivers are typically fastest; however they need to certified on a case-by-case basis. For driver information, consult the JDBC links on the Sun Microsystems Web site:
    www.javasoft.com
  • The TxJDBC drivers associated with IBM WebSphere Application Server Version 3.0x are no longer required.

Note that these are only guidelines. It is recommended that you evaluate and confirm the suitability of a driver for your particular business environment.

Merant SequeLink notes  Introduced in Version 3.5.3

  • The Merant SequeLink JDBC driver comprises two JAR files:
    • sljc.jar file, which contains all classes of the SequeLink JDBC driver that implement the JDBC 2.0 core API
    • sljcx.jar file, which contains all the classes of the SequeLink JDBC driver that implement the JDBC 2.0 Optional Package.

  • At the time of this writing, the Merant Web site advises the following:

    Use the method setBigDecimal instead of setLong. SequeLink maps the data type NUMBER of SQLServer to the JDBC data type NUMERIC.


    According to the JDBC specification, the Java type java.math.BigDecimal is the recommended mapping for JDBC data type NUMERIC. Therefore, use the setBigDecimal or getBigDecimal methods respectively to bind or retrieve the NUMERIC data type of Microsoft SQL Server.

    Check the Merant Web site for updates to this information.

Administering JDBC use on your operating system

Ensure that your operating system environment is set up to enable JDBC 2.0 use. 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

To enable JDBC 2.0 use on Windows NT systems:

  1. Run the following batch file:
    C:\SQLLIB\java12\usejdbc2.bat

    (In some cases, the file is named jdbc20.exe.)

  2. Stop WebSphere Application Server (if it is running) and start it again.

Changing from JDBC 2.0 to JDBC 1.0 for DB2 on Windows NT

To reverse the changes and return to a JDBC 1.x driver with JDK 1.1.x settings, run the batch file as follows:

  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. (Note: If the JVIEW process is active, you must use the Task Manager utility to stop it.)
  4. Run the batch file:
    C:\sqllib\java12\usejdbc1.bat
  5. Start the DB2 services.

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

To see whether JDBC 1.x or 2.0 is in use on your system, view the following file:

C:\sqllib\java12\inuse

Enabling JDBC 2.0 with DB2 on UNIX

  On UNIX, perform these steps before installing or starting WebSphere Application Server.

To enable JDBC 2.0 use with DB2 on UNIX systems:

  1. Ensure that DB2 is stopped.
  2. Set up the root user to run the following script:
    #DB2_root/java12/usejdbc2.sh

    where DB2_root is the directory in which your DB2 product is installed.

Determining the level of JDBC in use for DB2 on your UNIX system

To see whether JDBC 1.x or 2.0 is in use on your system, do the following:

  1. View the WebSphere Application Server admin.config file.
  2. In the file, check the administrative server classpath setting to ensure it includes the DB2 java12 directory (for JDBC 2.0) or the DB2 java directory (for JDBC 1.x).

Using JTA drivers

Instructions are available for using JTA drivers on particular operating systems. See your operating system's documentation for more information.

Using JTA drivers for DB2 on Windows NT

To enable JTA drivers for DB2 on Windows NT, 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. (Note: If the JVIEW process is active, you must use the Task Manager utility to stop it.)
  4. Run the batch file:
    C:\sqllib\java12\usejdbc2.bat
  5. Start the DB2 services.
  6. Configure DB2 to use JTS as the transaction processing (TP) monitor. From the DB2 Control Center, follow these steps:
    1. Right-click the DB2 instance that contains the database that is to be enabled for JTA access.
    2. Click Multisite Update, Configure to start the Smartguide utility.
    3. Click the Use the TP monitor named below radio button.
    4. Select JTS as the TP monitor.
    5. Click Done.
  7. 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 that is to be JTA enabled, and db2home is the DB2 root installation directory path (for example, d:\sqllib\bnd\@db2cli.lst).

  8. When you use an IBM WebSphere Application Server administrative client (such as the WebSphere Administrative Console) to configure a JDBC driver, specify the following settings:

    • Class name = COM.ibm.db2.jdbc.app.DB2Driver
    • URL prefix = jdbc:jta:db2
    • JTA enabled = True

Using JTA drivers for DB2 on UNIX

To enable JTA drivers on UNIX, follow these steps:

  1. Stop all DB2 services.
  2. Stop the IBM WebSphere Application Server administrative service.
  3. Stop any other processes that use db2java.zip file.
  4. Run the batch file:
    #DB2_root/sqllib/java12/usejdbc2.sh

    where DB2_root is the directory in which your DB2 product is installed.

  5. Start the DB2 services.
  6. When you use an IBM WebSphere Application Server administrative client (such as the WebSphere Administrative Console) to configure a JDBC driver, specify the following settings:

    • Class name = COM.ibm.db2.jdbc.app.DB2Driver
    • URL prefix = jdbc:jta:db2
    • JTA enabled = True

Using JTA drivers for Oracle via Merant SequeLink 5.1 on Windows NT

To enable JTA drivers for use with Oracle via SequeLink on the Windows NT operating system, follow these steps:

  1. Setting up Oracle 8.1.6:
    • Use the following command at the Oracle command promt to create the user:
      create user dbuser1 identified by dbpwd1 default tablespace users \
      temporary tablespace temp profile default account unlock;
      
    • Ensure XA connectivity for the user by issuing the following command at the Oracle command prompt:
      grant select on "SYS"."DBA_PENDING_TRANSACTIONS" to dbuser1;
      
  2. Setting up direct database authentication through SequeLink Manager:

    • In SequeLink Services, SLOracle51, Configuration, Service Settings, and User Security, set ServiceAuthMethods to Anonymous.
    • In SequeLink Services, SLOracle51, Configuration, Data Source Settings, Default, and User Security, set DataSourceLogonMethod to DBMSLogon(UserID,Password).
    • Because the XAOpen string, containing the user ID and password, is stored in the trace log, to ensure security, enter the following setting: In SequeLink Services, SLOracle51, Configuration, Service Settings, Logging set ServiceDebugLogLevel to either Fatal or Errors.

  3. Setting up WebSphere Application Server:

    • When you create your new JDBC driver, the URL prefix defaults to the following:
      jdbc:sequelink//hostname:19996
      

      Change hostname to the name of your machine, and enter the port number you are using, represented here by the SequeLink default of :19996.

    • When you create the data source, enter the Oracle environment variable ORACLE_SID in the Database Name field.

      Enter the Oracle environment variable ORACLE_SID.

    • Select your server, and on the General tab, click Environment. Add the CLASSPATH variable, and set its value to the path in which the SequeLink Client is installed, for example:
      #$WAS_HOME/driver/lib/sljcx.jar
      

      where $WAS_HOME is the location where WebSphere Application Server is installed.

Using JTA drivers for Sybase on AIX

To enable JTA drivers for use with Sybase on the AIX operating system, follow these steps:

  1. At a command prompt, enable the Data Transaction Manager (DTM) by issuing these commands (one per line):
    isql -Usa -Ppassword -Sservername
    sp_configure "enable DTM", 1
    go
    
  2. Stop the Sybase Adaptive Server database and start it again.
  3. At a command prompt, grant the appropriate role authorization to the EJB user:
    isql -Usa -Ppassword -Sservername
    grant role dtm_tm_role to EJB
    go
    

Notes about Sybase JTA drivers

Do not use a Sybase 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 the Sybase JTA connection must be used in a global transaction context.

Go to previous article: Guidelines for including databases in DMZ configurations Go to next article: InstantDB considerations

 

Go to previous article: Guidelines for including databases in DMZ configurations Go to next article: InstantDB considerations