DB2 databases

DB2 databases also provide data independence, offering a logical view of the database as a series of tables that you can interrelate more or less as you wish. DB2® lets you manipulate these tables without needing to know how they are organized. DB2 databases are processed by the IBM® licensed program DB2 Universal Database™ for z/OS® and OS/390®.

CICS® has one interface to DB2--the EXEC SQL interface, which offers powerful statements for manipulating sets of tables--thus relieving the application program of record-by-record (segment-by-segment, in the case of DL/I) processing.

CICS applications that process DB2 tables can also access DL/I databases. Any CICS resources (files, transient data, and so on), DL/I, and DB2 can be accessed from within one transaction. See the CICS IMS Database Control Guide for information about what databases and resources you can access.

For information about SQL commands, which are not discussed in this book, see the DB2 Universal Database for OS/390 and z/OS Application Programming and SQL Guide.

Requests to DB2

Requests from CICS applications to DB2 are made using EXEC SQL commands. DB2 runs in its own address space, like DBCTL. The CICS-DB2 and the CICS-DBCTL interfaces are similar in that they both use the task-related user exit interface (also known as the resource manager interface (RMI)) and have a two-phase commit process. However, they differ in a number of respects. For example, the CICS-DB2 interface uses the task-related user exit interface (also known as the resource manager interface, RMI) and has a two-phase commit process. CICS supports DBCTL and remote DL/I, and has to determine at PSB schedule time which of them is being used.

When an application issues an EXEC SQL command, the following processing takes place:

  1. The RMI is invoked from a stub that is link-edited to the application.
  2. If this is the first DB2 request from this task, the RMI sets up a task interface element (TIE).
  3. The RMI invokes the DB2 task-related user exit.
  4. The DB2 task-related user exit services the request. It suspends the task that made the request: returns the response and data to the application, then resumes the requesting task, before returning control to the RMI.
  5. Control is returned to the application.

The processing steps are illustrated in Figure 81. and are the responsibility of DB2, until control is returned to the RMI

Figure 81. How EXEC SQL requests are processed
 This figure is a flowchart showing how EXEC SQL requests are processed. Control passes from the application to the RMI, into DB2, and back to the RMI, as described in the preceding text.
[[ Contents Previous Page | Next Page Index ]]