Exercise 1.1: Selecting the resource adapter
This tutorial illustrates how to use the J2C wizard to build a simple Web application that processes an IMS transaction that returns a phone book record.
Before you can begin this tutorial, you must first obtain the required resources:
- Connection to a IMS server: In this tutorial, your application interacts with an IMS program on a server. Specifically, you need to perform some setup work on the IMS server machine, where you want the Phonebook IMS program to run. These steps are not covered: contact your IMS server administrator for setup information and to obtain connection properties for your IMS server.
- A copy of the COBOL copy book EX01.cbl You may locate this file in your product installation directory: \rad\eclipse\plugins\com.ibm.j2c.cheatsheet.content_6.0.0\Samples\IMS\phonebook. If you wish to store it locally, you can copy the code from here: EX01.cbl
- A clean workspace.
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.
Selecting the IMS Resource Adapter and connecting to the IMS 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 Selection page, , select either the J2C 1.0 or J2C 1.5 IMS resource adapter. For this tutorial select IMS Connector for Java (IBM: 9.1.0.1.2). Click Next.
In the Connection Properties page, de-select the Managed Connection check box and select Nonmanaged connection. (For this tutorial, you will use a non-managed connection to directly access IMS.) Accept the default Connection class name of com.ibm.connector2.ims.ico.IMSManagedConnectionFactory. In the blank fields, enter all the required connection information. Required fields, indicated by an asterisk (*), include the following:
For TCP/IP connection:
- Host name: (Required) The IP address or host name of IMS Connect.
- Port Number: (Required) The number of the port used by the target IMS connect.
For local option connection:
- IMS Connect name: (Required) The name of the target IMS connect.
For both:
- Data Store Name: (Required) The name of the target IMS datastore.
You may obtain the connection information from your IMS 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.