The ECI
COMMAREA
sample consists of a stateless session
bean, a client application, and a custom record that demonstrates using the
Streamable interface. The following files are part of the sample:
- ECIDateTime.java
- Enterprise bean remote interface
- ECIDateTimeHome.java
- Enterprise bean home interface
- ECIDateTimeBean.java
- Enterprise bean implementation
- ECIDateTimeClient.java
- Enterprise bean client program
- JavaStringRecord.java
- Custom Record
- Ejb-jar-eci-1.1.xml
- Example of a deployment descriptor
The deployment descriptor is an example of an EJB 1.1–compliant deployment
descriptor for this Enterprise Bean. If you wish to package it up into a jar
file, rename it to Ejb-jar.xml and store it in the META-INF
directory of the jar file. It may require further entries if it is to be deployed
into an EJB 2.0–compliant environment.
See your J2EE Server documentation for information on how to compile and
deploy the bean within your environment. However, you need to ensure that
the following jar files are also available on the CLASSPATH:
- cicsj2ee.jar
- connector.jar
- ctgclient.jar
- ccf2.jar
The enterprise bean looks for an ECI connection factory named
java:comp/env/ECI.
The bean must refer to this resource when deployed. Refer to your J2EE Server
documentation on how to deploy the resource adapter with an entry in the JNDI
with this name. The client program looks for the ECIDateTime bean with a name
of
ECIDateTimeBean1. See your J2EE Server document for details
of how to setup the bean with this JNDI name.
You will need to install the sever sample program EC01 on your CICS® Server.
This file can be found in the samples\server subdirectory of your CICS Transaction Gateway installation.
Further details of this sample can be found in the samples.txt file
in the samples folder.
The bean is a simple bean that outputs the date and time as
known to the CICS Server,
and can be deployed as a bean-managed transaction. The Custom record takes
a COMMAREA and converts it to a string. Ensure that the EC01 sample program,
which you installed on your CICS server, sends its results in ASCII, as the COMMAREA
is expected in ASCII. The JavaStringRecord does however allow for the selection
of other encodings, and is commented using JavaDoc. The Client program takes
no parameters. If your CICS server is running on
z/OS®,
the EC01 sample program will return its results in EBCDIC rather than ASCII.
To resolve this, update the DFHCNV table by adding lines similar to the following:
*
* CTG Sample conversion
*
*
DFHCNV TYPE=ENTRY,RTYPE=PC,RNAME=EC01,USREXIT=NO, *
SRVERCP=037,CLINTCP=8859-1
DFHCNV TYPE=SELECT,OPTION=DEFAULT
DFHCNV TYPE=FIELD,OFFSET=0,DATATYP=CHARACTER,DATALEN=18, *
LAST=YES