Defining tables in DB2

This task shows how to define the required DB2® tables.

Before you begin

The feature pack uses a JDBC connection from Java™ to DB2. Ensure that your DB2 system is installed and customized to allow connections from the IBM® Data Server Driver for JDBC 4. You can do this by including the DB2 JARs db2jcc4.jar and db2jcc_license_cicsuz.jar in the JVMProfile. These JARs are already included in the JVMProfile samples. For more information, see Configuring the JVM server profile. For more information about the IBM Data Server Driver for JDBC 4, see Installing the IBM Data Server Driver for JDBC and SQLJ in the DB2 Version 9 for z/OS documentation.

The feature pack requires a set of DB2 tables to save job status, job step status, and checkpoint information.

About this task

The sample batch application XDCGIVT demonstrates reading and writing to DB2. To run XDCGIVT, you must first configure and run DB2SAMP to create the DB2 table that is used by the application. For more information about the sample application, see Running the XDCGIVT sample in CICS.

Procedure

  1. Edit the JCL job <INSTALL_HLQ>.SDFHBATI(DFHBCDB2).
  2. Change <DB2INST> to the high-level qualifier for DB2, for example SYS2.DB2.V910
  3. Change <DB2NAME> to the name of the DB2 subsystem that CICS is connecting to. If you are not using DB2 V9.1, review and update (as appropriate) all instances of DSNTIA91 and DSN910P2.
  4. Review and update the security permissions on the SQL GRANT statements and the JCL job card.
    Note: The user ID that is specified in the CICS region's SIT Parameter DFLTUSER requires use of the table spaces, and requires all privileges on the tables. If DFLTUSER is not specified, then CICSUSER is assumed. In a secure setup, the user ID used to run inbound requests from the job scheduler requires use of the table spaces and all privileges on the tables.
  5. Save your changes and submit the job. The first time the job runs, the database does not exist, so the job completes with a return code of 8. When the job runs again, it completes with a return code of 0 because the database exists and can be deleted.


config_db2.html | Timestamp icon Last updated: Sunday, 4 June 2017