Restriction: This applies to native code only.
You can use COBOL and Java together, by coding the calls using the supplied support libraries.
You can also use the
Interface Mapping Toolkit Java itself provides access to other technologies, such as Remote Method Invocation (RMI) and Java Naming and Directory Interface (JNDI) which enable you to distribute objects across different machines.
You can use COBOL and Java together by:
- Mapping a Java interface onto procedural COBOL, using the Interface Mapping Toolkit, thereby exposing COBOL services without changing the COBOL code. The new interface then needs deploying, which involves deploying the generated EJB to J2EE and deploying the COBOL service to an enterprise server. At run time, the EJB running under J2EE calls the COBOL code, which runs under the control of an enterprise server.
- Calling procedural COBOL from Java, using the support provided in the
com.microfocus.cobol.RuntimeSystem class. This class is extended to provide the
CobolBean class. This
RuntimeSystem class support also enables you to call Java from procedural COBOL, through the Java Native Interface (JNI). This is ideal for use with Java 2 Standard Edition (J2SE).
- Calling Java from OO COBOL, using the Java object domain for OO COBOL. This is ideal for use with Java 2 Standard Edition (J2SE).
- Calling OO COBOL from Java,
creating a Java wrapper class that provides a function for each method in the OO COBOL class. This is ideal for use with Java 2 Standard Edition (J2SE).
You use
Server Enterprise Edition for running the other types of applications that use both COBOL and Java programs.
Server Enterprise Edition with Enterprise Server is required to run legacy programs exposed using the Interface Mapping Toolkit.
The Java language defines its own data types, which are different to the ones used in COBOL. The COBOL run-time system automatically converts between COBOL and Java types whenever you call Java from COBOL or COBOL from Java. Where a COBOL data type cannot be translated directly (for example, edited fields), it is under some circumstances translated to a string.