J2C Command Bean setup instructions

Before you import the sample

  1. Make sure you have a clean workspace.
  2. 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, where you want the CICS program to execute. These steps are not covered; contact your CICS server administrator for setup and for connection information to your CICS server.

After you import the sample

If you want to run the sample code, you need to configure the server and associate the sample with it using the following steps:

  1. To associate the sample with your CICS server, you need to change the connection information in the bean implementation class.
  2. Open up the CustomerImpl.java in a java editor, and change the following tag to include your CICS server connection information.
      /**
     * @j2c.managedConnectionFactory class="com.ibm.connector2.cics.ECIManagedConnectionFactory"
     * @j2c.managedConnectionFactory-property name="ServerName" value="your CICS server"
     * @j2c.managedConnectionFactory-property name="ConnectionURL" value="your connection URL"
     * @j2c.managedConnectionFactory-property name="UserName" value="userid"
     * @j2c.managedConnectionFactory-property name="Password" value="password"
     * @j2c.managedConnectionFactory-property name="TraceLevel" value="1"
     * @generated
     */
               
  3. Note that we are using the default port 2006. If your port number is different, you need to add a tag to define the port number.

Testing the application using the TestCustomerCommandBean program

To directly invoke and run the program, you will use the TestCustomerCommandBean.java file. You will pass in a CustomerNumber, and then the corresponding CustomerInfo will be returned.

  1. Go to TestCustomerCommandBean.java under the project Taderc99CommandBean and package sample.cics
  2. Right click to invoke Run -> Run As Application.

You will see the following in the console:

Congratulations, you have completed the J2C Command Bean sample.