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.

Using SQL Server as the administrative repository

To use SQL Server as the WebSphere Application Server administrative repository, ensure that you have the WebSphere Application Server database in your SQL Server. To create the Enterprise Manager in SQL server, complete the following steps:

  1. Go to the Enterprise Manager in SQL server and create a user EJSADMIN for the WebSphere Application Server database with password EJSADMIN and database administrator privileges.
  2. Create a user EJB on this database with password EJB and administrative privileges. The default server in WebSphere Application Server uses these users.

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.

With the JDBC programming model underlying WebSphere Application Server Version 4.0x, the term "JTA enabled" becomes somewhat odd, with respect to its Version 3.5 meaning. The goal of this section about "Using JTA drivers" is to provide information about the steps that make DB2 work nicely with applications utilizing XA classes -- that is, those whose dataSourceClasses implement javax.sql.XADataSource.

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 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.)
  3. Make sure that you already enabled JDBC 2.0.
  4. Start the DB2 services.
  5. 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.
  6. 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).

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

    • Server class path = %DB2_ROOT%/Sqllib/java/db2java.zip
    • Implementation class name = COM.ibm.db2.jdbc.DB2XADataSource

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

The Oracle 8.1.7 thin driver can be used for JTA two phase support with the following restrictions:

  • The thin driver that comes shipped with 8.1.7 may or may not work. Future patches from Oracle may work as well, but have not been tested. The driver that was available from the Oracle Technology Network Web site as of February 20, 2001 does work and is the recommended driver. Later versions on this Web site are expected to work, but have not been tested.

    To obtain the driver from the Oracle support Web, visit:

    http://technet.oracle.com/
    

    You will need to be a registered user for the Oracle Technology Network to get the driver from this site. Contact Oracle for how to get access. After you have access:

    1. On the left hand side of the screen, select "Software".
    2. On "Download Oracle Products, Drivers, and Utilities"
    3. On the "Select a Utility or Driver" selection, select "Oracle JDBC Drivers".
    4. Download the 8.1.7 driver for the platforms you use and follow the instructions for installing the new driver.

    The above instructions are subject to change with no notice to IBM. This version of the instructions could become inaccurate. Consult the Oracle site for the definitive instructions.

  • The 8.1.7 driver must be used with 8.1.7 databases. 8.1.6 databases do not support the recover() and forget() methods and other problems have been encountered running with 8.1.6. Oracle does not support JTA with 8.1.6.
  • For Oracle, JTA can only be used with container managed (CMP) beans.
  • In order for the bean to create the table, the bean must first be started the JTA set to false. After the bean has created the table, JTA can be set back to true.
  • An entity bean that accesses Oracle with JTA set to true must be configured as follows:
    • In the deployment descriptor properties, under Transactions, under the Remote tab, set the Transaction Attribute to REQUIRED.
    • Under Isolation, under the Remote tab, set the Isolation Level to READ_COMMITTED.
  • A session bean that is used with an entity bean that accesses Oracle with JTA set to true must be configured as follows:
    • In the deployment descriptor properties, under Transactions, under the Remote tab, set the Transaction Attribute to BEAN_METHOD.
    • Under Isolation, under the Remote tab, set the Isolation Level to READ_COMMITTED.

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: Removing data source configurations with the Web console Go to next article: Notes about various databases

 

 
Go to previous article: Removing data source configurations with the Web console Go to next article: Notes about various databases