Using a DB2 for zOS Local JDBC Provider (RRS) with WebSphere Application Server for z/OS

Why and when to perform this task

The DB2 for zOS Local JDBC Provider (RRS) requires that your installation at a minimum have DB2 for z/OS Version 7.1.0 or a later release installed. At the DB2 for z/OS version 7.1.0 release level, APAR PQ69861 is required to be installed. At higher release levels, this APAR will be integrated in the release.

Before you can use the DB2 for zOS Local JDBC Provider (RRS), your installation must configure the legacy DB2 for z/OS JDBC Driver to WebSphere Application Server for z/OS. This driver is packaged as a part of the DB2 release that is installed by your installation.

Steps for this task

  1. To configure the legacy DB2 for z/OS JDBC Driver to WebSphere Application Server for z/OS, the installation must perform the following steps:
    1. Update the PROCs for the servant address spaces to include the DB2 libraries. (optional)

      Installations have the option of placing the DB2 libraries in the linklist or //STEPLIB DD concatenation for the WebSphere Application Server for z/OS address spaces that will use JDBC. In some installations a combination of techniques are used. If your installation does not have SDSNEXIT, SDSNLOAD and SDSNLOD2 in the linklist, then you must update the //STEPLIB DD concatenation for the servant address space with the missing libraries.

      Consider the following example:

      The system on which WebSphere Application Server for z/OS Version 5 is active has multiple DB2 subsystems of different versions. There are the JUDY and DBP3 subsystems, where DBP3 is the default DB2 subsystem from a linklist perspective. The p5serv1 server uses the JUDY subsystem, hence the servant address space associated with the p5srv1 server must specify the appropriate DB2 libraries in the //STEPLIB DD concatenation.

      On this system, the servant address space uses procedure P5NCASR, which includes member P5NCASRZ, which contains the //STEPLIB DD concatenation. The last three lines in the following are the updates, which were made for JDBC access to the JUDY subsystem.

       //* P5NCASRZ
      //*
      //* Output DDs
      //*
      //CEEDUMP DD SYSOUT=*
      //SYSOUT DD SYSOUT=*
      //SYSPRINT DD SYSOUT=*
      //*
      //*Steplib Setup
      //*
      //STEPLIB DD DISP=SHR,DSN=WAS500.WAS.SBBOLD2
      // DD DISP=SHR,DSN=WAS500.WAS.SBBOLOAD
      
      // DD DISP=SHR,DSN=DSN710.JUDY.SDSNEXIT
      // DD DISP=SHR,DSN=DSN710.SDSNLOAD
      // DD DISP=SHR,DSN=DSN710.SDSNLOD2
      
      //*

    2. Create/update the db2sqljjdbc.properties file to indicate the location of the DSNJDBC_JDBCProfile.ser file

      The db2sqljjdbc.properties file contains information which the DB2 JDBC driver uses to configure itself. The following are the contents of the db2sqljjdbc.properties file created for the use of the WebSphere Application Server for z/OS servers running in node nodec of cell p5cell and in particular server p5srv1.

      The area near the bottom under db2.connpool.max.size=100 indicates the new means by which the location of the DSNJDBC_JDBCProfile.ser file is specified as of APAR PQ69861.

      # >>> Start of p5nc_wscjudy_db2sqljjdbc.properties <<<
      #
      # Any lines starting with the pound sign '#'
      # are comments. Please see the DB2 for OS/390
      # Application Programming Guide and Reference
      # for Java for the description of these settings.
      #
      #
      # This DBRMLIB is specific for the DSN7 subsystem and the JDBC driver.
      #
      #DB2SQLJDBRMLIB=DSN710.DBRMLIB.DATA
      #
      # This is installation specific: the name of the DB2 subsystem to use.
      #
      DB2SQLJSSID=JUDY
      #
      # The next 5 items are default values which are coded for documentation
      #
      #
      DB2SQLJPLANNAME=DSNJDBC
      DB2SQLJJDBCPROGRAM=DSNJDBC
      DB2SQLJMULTICONTEXT=YES
      DB2SQLJATTACHTYPE=RRSAF
      DB2CURSORHOLD=YES
      #
      #
      # The following items are for tracing, there are no default values
      #
      #DB2SQLJ_TRACE_FILENAME=/tmp/p5srv1_jdbc
      #DB2SQLJ_TRACE_BUFFSIZE=256
      #DB2SQLJ_TRACE_WRAP=1
      #
      #
      db2.connpool.max.size=100
      #
      # The following allows the JDBC driver to find and
      # load the serialized profile.
      #
      db2.jdbc.profile.pathname=/usr/lpp/db2710/classes/DSNJDBC_JDBCProfile.ser
      #
      # <<< End of p5nc_wscjudy_db2sqljjdbc.properties >>>

      The key entries in this file are:

      DB2SQLJSSID
      Identifies the DB2 subsystem (for example, JUDY) that should be used by the JDBC driver
      db2.jdbc.profile.pathname
      Identifies the serialized profile (for example, /usr/lpp/db2710/classes/DNSJDBC_JDBCProfile.ser) to be used by the JDBC driver. This is a new property introduced by APAR PQ69861.

      Notes:

      1. WebSphere Application Server for z/OS has always recommended specifying the db2sqljjdbc.properties and contents rather than assuming the defaults. While it is possible for the JDBC driver to locate the DB2 subsystem through specifying SSID in the DSNHDECP module, which resides in SDSNEXT library, rather than db2sqljjdbc.properties file, it is useful having a properties file for several reasons. Being able to specify the location of the serialized profile makes the definition of the DB2 for zOS Local JDBC Provider (RRS) less complicated.
      2. This file must be placed in the HFS in a directory that is readable by all the servant address spaces on the z/OS image. It must be in codepage Cp1047, which is an EBCDIC code page.

    3. Create or update the environment variables so the WebSphere Application Server for z/OS server can locate the DB2 home directory and the JDBC driver can locate the db2sqljjdbc.properties file

      The WebSphere Application Server for z/OS configuration needs to have WebSphere Application Server for z/OS and POSIX environment variables set so that the DB2 home directory and the db2sqljjdbc.properties file can be located. From the WebSphere Application Server for z/OS Administrative Console, click Environment > Manage WebSphere Variables. Select the node level view and click Apply.

      There are two variables of interest.

      1. DB2390_JDBC_DRIVER_PATH This variable will be present but have no assigned value. Update this value to the directory in which the DB2 code resides. For example: /usr/lpp/db2/db2710
      2. DB2SQLJPROPERTIES This variable will not be present. Add this value to indicate the location and name of DB2 JDBCSQLJ properties file which you created for this node. For example: /shared/zWebSphere/V5/misc/p5nc_wscjudy_db2sqljjdbc.properties

      Notes:

      1. These variables are set at the node level and thus are applicable to all servers in the node residing on this system. They can be set at the server level instead of or in addition to setting them at the node level.
      2. The DB2390_JDBC_DRIVER_PATH variable could actually be set at the cell level and removed from the node level definitions if all nodes in the cell will use the same DB2 home directory.
      3. The DB2SQLJPROPERTIES should not be set at the cell level, as it contains the specific DB2 subsystem to which the JDBC driver will use.
      4. The /shared/zWebSphere/V5/misc/ directory is a commonly accessible directory for all systems in the sysplex. The name of the file indicates which cell (for example, p5) and node (for example, nc) that it is intended to be used. It is certainly possible to use a non-shared directory that is system specific (for example, /etc/zWebSphere/V5/misc/...)
      5. After these updates have been made and saved, it is necessary to restart the server to have the server use the //STEPLIB DD updates from Step 1, if required, and to have the POSIX runtime environment variables refreshed with the changes made in this step. This restart can be delayed, but it must be done before any DataSources created under this provider can be used.

    4. Define any J2C authentication aliases you might need to provide the user ID and password information used to connect to DB2.

      To define an authentication alias, from the WebSphere Application Server for z/OS Administrative Console, click Security > JAAS Configuration > J2C Authentication Data.

      Click New and specify an alias, a userid and a password that can be passed to DB2 (or any other J2C resource), then click Apply.

      Note: Add as many aliases as you require for access to DB2.

  2. To define a DB2 for zOS Local JDBC Provider (RRS) and to then define a datasource under that provider, you must do the following:
    1. Define a DB2 for zOS Local JDBC Provider (RRS) for DB2 for z/OS access.

      From the WebSphere Application Server for z/OS Administrative Console, click Resources > JDBC Providers. Select the server on which you want to install a DB2 for zOS Local JDBC Provider (RRS) and click Apply.

      Click New. In the list of JDBC providers, select DB2 for zOS Local JDBC Provider (RRS), then click Apply.

    2. Define a DataSource.
      Select Data source to create a data source for a J2EE 1.3 compliant application. (If your application adheres to the J2EE 1.2 specification, select Data source Version 4.

      Click New. Define data source properties that are required for use of the Legacy DB2 for OS/390 and z/OS JDBC driver:

      • A Name
      • A JNDI name
      • A Component-managed Authentication Alias (optional) for connection authentication
      • A Container-managed Authentication Alias (optional) for connection authentication

      Indicate if you want this data source to be used for container-managed persistence, then click Apply. Save all of your changes to the master configuration.

      Next, specify the DB2 database name. Click the data source link in the table; on the next panel, click Custom Properties.

      Now you see a panel where you can update the databaseName variable. Click on the databaseName field and specify the database for which you created the data source. For this example, the location name is the one associated with the JUDY DB2 subsystem and is called: wscjudy.

      Optional: Configure optional custom properties that the Legacy DB2 for OS/390 and z/OS JDBC driver supports. Learn about these properties in the Application Programming Guide and Reference for Java for your version of DB2 for z/OS.

      Click Apply and save all of your changes to the master configuration.

What to do next

Now you are ready to install an application and test your DataSource.

Related tasks
Creating and configuring a data source using the administrative console
Creating and configuring a JDBC provider using the administrative console
Creating and configuring a JDBC provider and data source using the Java Management Extensions API
Configuring data access for application clients[5.0 only][Version 5.0.1][Version 5.0.2]
Creating and configuring a JDBC provider and data source



Searchable topic ID:   jdbcdb2zos
Last updated: Jun 21, 2007 9:56:50 PM CDT    WebSphere Application Server for z/OS, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/tdat_jdbcdb2zos.html

Library | Support | Terms of Use | Feedback