Using an Unmanaged Connection under J2SE

In this case, the connection is unmanaged. Your code runs in a J2SE environment with the libraries from the Java application server. Although this avoids the overhead of administering a Java application server, you lose its advantages such as transaction support.

To deploy an unmanaged connection, all you need to do is to update your classpath to include the classes that provide support for the Micro Focus resource adapters. These classes are packaged in mfcobolpure.jar and mfconnector.jar. There are two versions of these files: one for J2EE 1.3 and one for J2EE 1.4, and these are available in the base\bin\j2ee13 and base\bin\j2ee14 directories.

The code you write needs to use CCI. The CCI defines an API for resource adapters connecting to Enterprise Information Servers (EISs), such as Enterprise Server. Micro Focus also supplies some extension classes specific to using the Micro Focus resource adapters.

In summary the code:

  1. Imports the Java and Micro Focus classes
  2. Gets a connection
  3. Gets an interaction
  4. Sets the InteractionSpecs for the interaction
  5. Executes the interaction
  6. Gets the results
  7. Closes the connection

The CCI classes and some of their methods include:

The Micro Focus extensions are supplied in the com.microfocus.cobol.connector.cci package and are documented in the J2EE 1.3 Connector Class Library Reference and J2EE 1.4 Connector Class Library Reference. The com.microfocus.cobol.connector.cci package provides classes such as: