InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.14: Administering database connections (overview) >
6.6.14.5: Additional administrative tasks for specific databases

6.6.14.5: 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 in order 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 WebSphere Application Server product prerequisites 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 enable JDBC 2.0 use. This is required in order 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

To enable JDBC 2.0 use on Windows NT systems:

  1. Stop the DB2 JDBC Applet Server service.
  2. Run the following batch file:
    SQLLIB\java12\usejdbc2.bat
  3. Stop WebSphere Application Server (if it is running) and start it again.

Perform the steps once for each system.

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

To see whether the JDBC level in use on your system:

  • If JDBC 2.0 is in use, this file will exist:
    SQLLIB\java12\inuse
  • If JDBC 1.0 is in use, this file will exist:
    SQLLIB\java11\inuse
    or there will be no java11 directory
Enabling JDBC 2.0 with DB2 on UNIX

Before starting WebSphere Application Server, you need to call $INSTHOME/sqllib/java12/usejdbc2 to use JDBC 2.0. For convenience, you might want to put this in your root user's startup script. For example on AIX, add the following to the root user's .profile:

if [ -f /usr/lpp/db2_07_01/java12/usejdbc2 ] ; then
. /usr/lpp/db2_07_01/java12/usejdbc2
fi
Determining the level of JDBC in use for DB2 on your UNIX system

To determine if you are using JDBC 2.0, you can echo $CLASSPATH. If it contains

$INSTHOME/sqllib/java12/db2java.zip
then JDBC 2.0 is in use.

If it contains

$INSTHOME/sqllib/java/db2java.zip
then JDBC 1.0 is in use.

Sourcing the db2profile script on UNIX

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 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. Make sure that you already enabled JDBC 2.0.
  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:\ProgramFiles\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. Make sure that you already enabled JDBC 2.0.
  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.

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.
Go to previous article: Property files pertaining to database connections Go to next article: Notes about various databases

 

 
Go to previous article: Property files pertaining to database connections Go to next article: Notes about various databases