Exercise 1.1: Selecting the resource adapter
This tutorial will lead you through the detailed steps to generate a J2C application that interfaces with a CICS transaction using an External Call Interface (ECI). The service is built from a CICS COBOL function, getCustomer, which accepts a customer number and returns the customer's information, as shown in this diagram.
Before you can begin this tutorial, you must first obtain the required resources:
- Connection to a CICS ECI server: In this tutorial, your application interacts with a CICS program on a server. Specifically, you need to set up a CICS transaction gateway on a machine to access the server. You also need to perform some setup work on the CICS server machine, where you want the CICS to execute. These steps are not covered.
- A copy of the COBOL file taderc99.cbl. You may locate this file in your product installation directory: \rad\eclipse\plugins\com.ibm.j2c.cheatsheet.content_6.0.0\Samples\CICS\taderc99. If you wish to store it locally, you can copy the code from here: taderc99.cbl
- A clean workspace.
Using the J2C Java bean wizard to select the resource adapter
Switching to the J2EE Perspective
If the J2EE icon,
, does not appear in the top right tab of the workspace, you need to switch to the J2EE perspective.
- From the menu bar, select Window > Open Perspective > Other. The Select Perspective window opens.
- Select J2EE.
- Click OK. The J2EE perspective opens.
Connecting to the CICS ECI server
- In the J2EE perspective, select File > New > Other.
- In the New page, select J2C > J2C Java Bean. Click Next
Note: If you do not see the J2C option in the wizard list, you need to Enable J2C Capabilities.
- From the menu bar, click Window > Preferences.
- On the left side of the Preferences window, expand Workbench.
- Click Capabilities. The Capabilities pane is displayed. If you would like to receive a prompt when a feature is first used that requires an enabled capability, select Prompt when enabling capabilities.
- Expand Enterprise Java.
- Select Enterprise Java. The necessary J2C capability is now enabled. Alternatively, you can select the Enterprise Java capability folder to enable all of the capabilities that folder contains. To set the list of enabled capabilities back to its state at product install time, click Restore Defaults.
- To save your changes, click Apply, and then click OK. Enabling Enterprise Java capabilities will automatically enable any other capabilities that are required to develop and debug J2C applications.
In the Resource Adapters page, under View by, select JCA version. Expand 1.5, and select ECIResourceAdapter (IBM:6.0.0) . Click Next.
In the Connection Properties page, select Nonmanaged connection check box. (For this tutorial, you will use the non-managed connection to directly access the CICS server, so you do not need to provide the JNDI name.) Accept the default Connection class name of com.ibm.connector2.cics.ECIManagedConnectionFactory. In the blank fields, provide connection information. Required fields are indicated by an asterisk (*):
- Server name: (Not required) The name of the CICS Transaction Gateway server.
- Connection URL*: (Required) The server address of the CICS ECI server
- Port number: (Not required) The number of the port that is used to communicate with the CICS Transaction Gateway. The default port is 2006.
- User name: (Not required) The user name for the connection.
- Password: (Not required) The password for the connection.
You may obtain the connection information from your CICS Server system administrator.
When you have provided the required connection information, click Next.
Now you are ready to begin Exercise 1.2: Setting up the Web project and Java Interface and Implementation.