The CCI Connector sample is a relatively simple application that shows
how to code the CCI APIs directly. It illustrates how to:
- Look up a previously-published connection factory in a JNDI namespace
- Use the CCI Connector for CICS® TS to call a CICS server program
The sample consists of:
- A CICS Java™ program
- A custom Record that demonstrates the use of the javax.resource.cci.Streamable interface
- A CICS COBOL server program
The sample works like this:
- A user starts the application by running the CCCI transaction from a CICS
terminal.
- The CICS Java program, CICSCCISample (DFJ$CCIC), is started.
The Java program:
- Asks the user to input a sequence of random, unsorted, decimal numbers
- Does a JNDI lookup of the name server, to obtain a CICS connection factory
- If a connection factory has not been published to the name server, creates
one programatically
- Uses the connection factory to create a connection to CICS
- Creates an Interaction object from the Connection object,
and sets the properties of the interaction (including the name of the target
program) by means of an ECIInteractionSpec object
- Uses the Interaction.execute method to link to the COBOL program,
DFH$0CCIS, passing as input (in a custom Record object) the user's
sequence of unsorted numbers, plus the ECIInteractionSpec object
- The COBOL program sorts the numbers into ascending order and returns the
sorted sequence in its output COMMAREA.
- The Java program retrieves the COBOL program's output from the output Record object
and displays the sorted list on the user's terminal.
Figure 1 shows the components of the sample
application.
Figure 1. Overview of the CCI Connector sample
application.
The main elements of the sample are a CICS Java program
and a CICS COBOL server program. The Java program uses the CCI Connector for
CICS TS to link to the COBOL server program. The CICS connection factory can
be published to either a COS Naming Server or an LDAP name server.