Exercise 1.3: Creating a Java method

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

Exercise 1.3 leads you through the creation of a Java method. In this exercise you will

Creating a Java method

  1. In the Project Explorer view, expand the project InOutArray in Dynamic Web Projects.
  2. Right-click on InOutImpl.java in JavaSource and select Source > Add method to J2C Java bean.
  3. In the Java Method page click Add.
  4. In the Java method name field, type runInOut for the name of the method.
  5. Click Next.

Creating the input data mapping between COBOL and Java

  1. Beside the Input type field of the Java Method page, click New.
  2. In the Data Import page, ensure that the Choose mapping field is COBOL_TO_JAVA. Click Browse beside the Cobol file field.
  3. Browse to find the file location of the InEqualsOut.cbl file (You can find a copy in your product installation folder: \rad\eclipse\plugins\com.ibm.j2c.cheatsheet.content_6.0.0\Samples\IMS\InOutArray).
  4. Click Open.
  5. Click Next.
  6. In the COBOL Importer page, click Show Advanced.
  7. In the Saving Properties page,
  8. In the Java Method page, select Use input type for output.
  9. Click Finish.
  10. Click Finish to complete the definition of the method.
  11. In the Java Methods page, click Finish.

Now you are ready to begin Exercise 1.4: Creating a Java proxy class to test your application.

Terms of use | Feedback

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