Making JDBC and SQLJ work in the CICS DB2 environment

When a Java™ application for CICS® makes JDBC and SQLJ requests, the requests are processed by a JDBC driver supplied by DB2®. In a CICS environment, the DB2-supplied JDBC driver is link-edited with the CICS DB2 language interface (stub) DSNCLI. The driver converts the JDBC or SQLJ requests into their EXEC SQL equivalents. The converted requests from the DB2-supplied JDBC driver flow into the CICS DB2 attachment facility in exactly the same way as EXEC SQL requests from any other program (for example, a COBOL program). So there are no operational differences between Java programs for CICS DB2 and other programs for CICS DB2, and all customization and tuning options available using RDO apply to Java programs for CICS DB2.

Start of changeDB2 Version 6 provides the JDBC 1.2 driver, that supports the JDBC 1.2 application programming interface. DB2 Version 7 provides three levels of the JDBC driver, the 1.2 level, the 2.0 level, and the DB2 Universal JDBC Driver. DB2 Version 8 provides two levels of the JDBC driver, the 2.0 level and the DB2 Universal JDBC Driver. Java programs and enterprise beans written for CICS can use any of these JDBC drivers.End of change

The JDBC 2.0 driver supports a selected subset of the JDBC 2.0 application programming interface, and it is downward compatible, so it supports the JDBC 1.2 API as well. Existing Java applications and enterprise beans that were written using the JDBC 1.2 API and that run in a JVM, can run using the JDBC 2.0 driver, and can benefit from performance improvements made in the JDBC 2.0 driver. If you create new Java applications and enterprise beans that use the JDBC 2.0 API, you need to use the JDBC 2.0 driver or the DB2 Universal JDBC Driver.

Start of changeThe DB2 Universal JDBC Driver provides enhanced support for the JDBC 2.0 programming interface and most of the JDBC 3.0 application programming interface. Like the JDBC 2.0 driver, it is downward compatible, so it supports the JDBC 1.2 API as well. Because it is an entirely new driver, rather than a follow-on to the JDBC 2.0 driver, you can expect some differences in behavior between this driver and the JDBC 1.2 and 2.0 drivers. For more information about the DB2 Universal JDBC Driver, see the the DB2 Universal Database™ for OS/390® and z/OS® Application Programming Guide and Reference for Java which is appropriate to your version of DB2. The document number for DB2 Version 7 is SC26-9932, and the document number for DB2 Version 8 is SC18-7414.End of change

To use a JDBC driver provided by DB2, CICS must be connected to a DB2 subsystem that supports the appropriate level of JDBC driver. For example, when CICS is connected to a DB2 Version 6 subsystem, you cannot use the JDBC 2.0 driver provided by DB2 Version 7 or by DB2 Version 8.

The following table summarizes which level of the JDBC driver is supported by which versions and releases of CICS and DB2.

Table 8. Support for the JDBC driver in CICS and DB2
Product JDBC driver supported
DB2 Version 6 (with APAR PQ84783) 1.2 level
DB2 Version 7 (with APAR PQ84783) 1.2 level and 2.0 level
Start of changeDB2 Version 7 (with APAR PQ86525)End of change Start of changeDB2 Universal JDBC DriverEnd of change
DB2 Version 8 (with APAR PQ84783) 2.0 level
Start of changeDB2 Version 8 (with APAR PQ86525)End of change Start of changeDB2 Universal JDBC DriverEnd of change
CICS TS for OS/390 Version 1 Release 3 (with APAR PQ34321) 1.2 level
Start of changeCICS TS for z/OS Version 2 Release 2 (with APARs PQ57455 and PQ85283)End of change Start of change1.2 level, 2.0 level and DB2 Universal JDBC DriverEnd of change
Start of changeCICS TS for z/OS Version 2 Release 3 (with APAR PQ85283)End of change Start of change1.2 level, 2.0 level and DB2 Universal JDBC DriverEnd of change
CICS TS for z/OS Version 3 Release 1 1.2 level, 2.0 level and DB2 Universal JDBC Driver

Requirements to support Java programs in the CICS DB2 environment has information on the system requirements to support each level of the JDBC driver.

Full details of how to code and build Java applications that use the JDBC and SQLJ application programming interfaces can be found in the DB2 Universal Database for OS/390 and z/OS Application Programming Guide and Reference for Java that applies to your version of DB2. The document number for DB2 Version 6 is SC26-9018, the document number for DB2 Version 7 is SC26-9932, and the document number for DB2 Version 8 is SC18-7414. Particular programming features apply to JDBC and SQLJ when they are used in a CICS environment, so read Programming with JDBC and SQLJ in the CICS DB2 environment for more specific guidance before developing your Java application.

Related tasks
Requirements to support Java programs in the CICS DB2 environment
Programming with JDBC and SQLJ in the CICS DB2 environment

Related concepts
Using JDBC and SQLJ to access DB2 data from Java programs and enterprise beans written for CICS
[[ Contents Previous Page | Next Page Index ]]