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
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
//*
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:
Notes:
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.
Notes:
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.
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.
Click New. Define data source properties that are required for use of the Legacy DB2 for OS/390 and z/OS JDBC driver:
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.