Exercise 1.3: Creating the Java method

Before you begin, you must complete Exercise 1.2: Setting up the Web Project and Java Interface and Implementations .

Creating a Java method

You will now create a Java method that will use the COBOL importer to map the data types between the COBOL source and the data in your Java method.

  1. In the Snippets view, select J2C. Right click Add Java method to J2C Java bean.
  2. In the Java method name field, type getCustomer for the name of the operation. Click Next.

Creating the input and output data mapping between COBOL and Java

In this step, you will import the taderc99.cbl (COBOL) file that is needed to create your application. The taderc99.cbl file is located in <RSDP_installdir>\rad\eclipse\plugins\com.ibm.j2c.cheatsheet.content_6.0.0\Samples\CICS\taderc99, where <RSDP_installdir> is the directory where this product is installed. The COBOL file contains the program that runs on the CICS server. It has the definition of the structure to be passed to the CICS server via the communications area (COMMAREA). This structure represents the customer records being returned from the CICS application. Before you can work with a file, you must import it from the file system into the workbench.

  1. In the Specify the input/output type of the Java Method page, click New.
  2. In the Data Import page, ensure that the Choose mapping field is COBOL_TO_JAVA.
  3. Click Browse beside the Cobol file field.
  4. Locate the taderc99.cbl file in the file system, and click Open.
  5. Click Next.
  6. In the COBOL Importer page, select a communication data structure.
  7. In the Saving properties page,
  8. In the Java method page, select Use Input for output. Click Finish.
  9. On the Java Method page, click Finish to complete the operation.
  10. In the functionName field, type the COBOL program id (TADERC99). Click Next.

Now you are ready to begin Exercise 1.4: Deploying the application.

Terms of use | Feedback

(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.