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 subdirectory of
%ProgramFiles(x86)%\Micro Focus\Visual COBOL\javaee\javaee7\appsrv directory, where
appsrv represents a directory 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. that corresponds to your application server. 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:
- Imports the Java and Micro Focus classes
- Gets a connection
- Gets an interaction
- Sets the InteractionSpecs for the interaction
- Executes the interaction
- Gets the results
- Closes the connection
The CCI classes and some of their methods include:
- Managed ConnectionFactory -
createConnectionFactory()
- ConnectionFactory -
get Connection(),
getRecordFactory()
- Connection -
createInteraction(),
getResultSetInfo(),
close()
- Interaction -
getConnection(),
execute(), getWarnings()
- Record -
getRecordName(),
clone()
- InteractionSpec - SYNC-SEND, SYNC_RECEIVE and so on
The Micro Focus extensions such as the following classes are supplied in the com.microfocus.cobol.connector.cci package:
- CobolConnectionFactory -
getConnection(),
getRecordFactory()
- CobolInteraction - execute(),
getWarnings()
- CobolInteractionSpec -
getInteractionVerb(),
setArgument()
- CustomRecord -
getRecordName(),
clone(),
hashCode()
- IndexedRecord -
lastIndexOf(),
contains(),
lastElement()
For instructions on viewing documentation for the com.microfocus.cobol.connector.cci package, see
COBOL Connector Class Library.