Creating Java data binding classes

The CICS/IMS Java™ Data Binding wizard enables you to create a class or set of classes that map to COBOL or to C data structures.

The J2C Java Data Binding wizard assists you in creating specialized Java classes representing the input and output messages of an EIS transaction from the corresponding COBOL or C data structures of the EIS application program. These specialized Java classes are called data bindings. Java data binding classes are used as input or output types for invoking CICS® or IMS™ functions. Once you create the binding classes, you can use the J2C wizard to create a Java bean and to create a method within the bean that uses the binding classes, as the following diagram illustrates:


J2C data binding wizard

Data bindings provide the Java application the mechanism for populating the input message with data and for retrieving data from the output message. The data bindings perform conversion between the Java (UNICODE) and host (EBCDIC) representations of the data.

To create a J2C Java bean that runs a CICS transaction, complete the following steps:

  1. If you do not see the J2EE icon, J2EE perspective icon, in the top right tab of the workspace, you need to switch to the J2EE perspective.
  2. To start the J2C dynamic wizard, from the menu bar, select File > New > Other > J2C.
    Note: If you do not see the J2C option in the wizard list, you need to Enable J2C Capabilities.
  3. Select CICS/IMS Java Data Binding.
  4. Click Next.
  5. On the Specify data import configuration properties page, you specify the data types that your binding class will use.
  6. On the Data Import page, you need to specify the data import configuration properties.

    Input and Output data binding

    Follow these steps to create both the Input and the Output data binding:

    1. In the Choose mapping field, the mapping type you want: select one of the following choices as the mapping type.
      • COBOL to Java
      • C to Java
      • COBOL MPO to Java (For output data bindings only)
      • C MPO to Java (For output data bindings only)
    2. COBOL to Java or C to Java
      • In the Data Import page, click Browse.
      • Locate the source file that will provide the input. You can import the following types of resources:
        • COBOL file (.ccp, .cbl, .cpy, or .cob files)
        • C file (.ccs, .h, or .c files)
      • Highlight the source file and click Open to query for the data binding types.
    3. C MPO to Java or COBOL MPO to Java
      • If you want to use a data type that already exists in your project,
        1. Click Browse to use a data type that already exists in your project.
        2. In the Select a data type page, highlight the class that contains the data binding (you can filter the list by typing entry field in the Select a data type field).
        3. Click Okay.
        4. Click Finish.
      • If you want to create a new data type,
        1. Click New, and the Java data binding wizard appears.
        2. In the Data Import page, besideMultiple possible output, click New.
        3. In the new Data Binding wizard that appears, click Browse.
        4. Locate the source file that will provide the input. You can import the following types of resources:
          • COBOL file (.ccp, .cbl, .cpy, or .cob files)
          • C file (.ccs, .h, or .c files)
        5. Highlight the source file and click Open to query for the data binding types.
This takes you to the Importer page for Cor COBOL files, where you specify the communication data structure your Java class will use.
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.