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 the following files:

mfcobolpure.jar
Located in the %ProgramFiles(x86)%\Micro Focus\Visual COBOL\bin and \bin64 directory by default.
mfconnector.jar
Located in the %ProgramFiles(x86)%\Micro Focus\Visual COBOL\javaee\javaee7\appsrv directory, where appsrv represents a subdirectory named for your Java application server and, in some cases, the version as well. For a list of supported application servers, see the Java Application Servers section of the Supported Operating Systems and Third-party Software topic. For example, the mfconnector.jar file for WebSphere 9.0 is located in a subdirectory named ibmwebsphere90.

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 such as the following classes are supplied in the com.microfocus.cobol.connector.cci package:

For instructions on viewing documentation for the com.microfocus.cobol.connector.cci package, see COBOL Connector Class Library.