WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Configuring WebSphere Application Server for DB2 access

This topic describes how to configure WebSphere Application Server Version 6.0.x on a Linux or UNIX-based platform to use multiple Version 8.1 DB2 clients.

Before you begin

WebSphere Application Server Version 6.0.x does not configure environment variables for accessing a DB2 database during installation. A database is not a prerequisite. Therefore, the installation and configuration of Version 6.0.x do not involve database configuration.

You can install multiple DB2 Version 8.x instances on the same Linux or UNIX machine. This topic describes configuring Version 6.0.x on a Linux or UNIX-based platform to use multiple Version 8.x DB2 clients.

See the IBM WebSphere Application Server supported hardware, software, and APIs Web site for information about required patches for DB2.

About this task

If your WebSphere Application Server, Version 6.0.x machine has only a Version 8.x client installed, and all DB2 data sources defined in WebSphere Application Server access DB2 databases through this client, source the db2profile file in the login profile of your Version 6.0.x instance owner, invoke the script db2_home/java12/usejdbc2 to use the JDBC2 drivers instead of the default JDBC1 drivers, and put the DB2 lib directory in the java.library.path variable.

For example, assume that the following values are true:
WebSphere Application Server instance owner, that is the administrative user who starts WebSphere Application Server adm00001
DB2 client instance owner db2inst1
DB2 client instance home /export/home/db2inst1

Procedure

  1. Update the .profile of user adm0001.
    Add the following line:
    . /export/home/db2inst1/sqllib/db2profile

    You can also add the line to the setupCmdLine.sh script of WebSphere Application Server.

  2. Specify the JDBC provider class path.
    You have two ways to specify the JDBC provider class path on the DB2 JDBC Provider definition panel of the WebSphere Application Server administrative console:
    • Leave the default value (${DB2_JDBC_DRIVER_PATH}/db2java.zip) as is. Click Environment > Manage WebSphere Variables in the administrative console. Set the DB2_JDBC_DRIVER_PATH variable to the value /export/home/db2inst1/sqllib/java12. This approach is preferred.
    • Enter the class path, such as /export/home/db2inst1/sqllib/java12/db2java.zip.

    Windows platforms support only one DB2 installation. The DB2 environment variables are populated in the system environment automatically. WebSphere Application Server does not need to set these environment variables.

  3. Set DB2-required environment variables for a particular application server.
    1. Open the WebSphere Application Server administrative console.
    2. Click Servers > Application servers > server_name; click the Configuration tab; and then under Server Infrastructure, click Java and Process Management > Process Definition > Custom Properties > New.
    3. Create a DB2INSTANCE entry.

      Enter DB2INSTANCE in the Name field, an instance name such as db2v8 in the Value field, and then click Apply.

    4. Create a library path entry.
      Create the appropriate library path:
      • AIX: LIBPATH entry
      • Linux: LD_LIBRARY_PATH entry
      • Solaris: LD_LIBRARY_PATH entry
      • HP-UX: SHLIB_PATH entry

      Use the value of the DB2 native library path, such as /export/home/db2v8/sqllib//lib for a Version 8.x client, or /export/home/db2v8B/sqllib/lib for another Version 8.x client.

      The DB2 lib directory must be on the java.library.path path. Otherwise the application server cannot load the db2jdbc.so library and cannot work with DB2. Even with the DB2 lib directory on the java.library.path path, you must invoke the /home/db2inst1/db2profile environment into the root shell before you start the application server.

  4. Configure the WebSphere Application Server product so that it can use both Version 8.1 clients.

    In cases where multiple Version 8.1 clients are installed on a WebSphere Application Server Version 5.x machine, and you intend to use two or more clients in your Version 6.0.x Application Servers, you can set DB2 environment variables within each application server, instead of setting them globally as shown previously.

    DB2 UDB Version 8 uses a new client and server communications mechanism that is based on distributed relational database architecture. While the new communications mechanism provides a number of advantages, it also introduces restrictions on the communications capability between DB2 Version 7 and Version 8 products.

    Because a number of restrictions exist when using a Version 8 client to communicate with a Version 7 server, this configuration is not recommended. However, a Version 7 client can access a Version 8 server without difficulty.

    If you have a WebSphere Application Server application that accesses both a Version 7 server (on a WebSphere Application Server Version 5.x machine) and a Version 8 server (on a WebSphere Application Server Version 6.0.x machine), use the DB2 Version 7 client on the WebSphere Application Server Version 5.x machine to access both the Version 7 server and the Version 8 DB2 server.

    WebSphere Application Server Version 6.0.x supports DB2 Version 8.x but does not support Version 7.

    You can choose to use a Version 7 client to access a Version 7 server, and use a Version 8 client to access a Version 8 server. This choice results in two versions of DB2 clients.

    When you use a Version 7 client (on a WebSphere Application Server Version 5.x machine) to access a Version 8 server, you must explicitly bind Version 7 packages to the Version 8 server. To bind packages in the Version 7 client environment, make a connection to the Version 8 server and bind both the db2cli.lst and the db2ubind.lst files. For example:
    cd /home/db2inst1/sqllib/bnd
    db2 connect to v8server
    db2 bind @db2cli.lst
    db2 bind @db2ubind.lst
    db2 terminate

    One WebSphere Application Server node can support multiple application server instances. Each application server is essentially a single Java runtime environment, which is one Java virtual machine (JVM). Each JVM can have its own set of environment variables that differ from other application server instances.

    You can set DB2 environment variables per application server instance to let each application server instance communicate with a single DB2 client instance. The client instance can have multiple databases cataloged.

    Such a configuration means that you cannot have one application server instance communicating with both a Version 7 client and a Version 8.1 client. However, you can create another application server instance to communicate with a different DB2 client.

  5. Match the appropriate data source to the application component.

    When mapping a data source to an application component, do not mismatch data sources from different DB2 client instances.

    For example, if you set the server1 application server instance to run in the DB2 Version 7 client instance, server1 application components can use only data sources defined under the same Version 7 client JDBC driver.

    WebSphere Application Server Version 6.0.x supports defining a JDBC provider on different scopes: cell, cluster, node (the default) and server. If you have different DB2 client instances, consider defining them on the server level instead of on the node or cluster level. Server level definitions avoid possible mismatches between the data sources and different DB2 JDBC providers.

Results

You can configure DB2 for use on WebSphere Application Server. Tune your WebSphere Application Server environment as you test it. Test all redeployed applications before moving them into production.

What to do next

Return to Task overview: Installing to continue.



Related tasks
Task overview: Installing
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tins_DB2.html

© Copyright IBM Corporation 2004, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)