In order to run the command bean sample, follow the instructions
below.
Before you begin
- Make sure you have a clean workspace.
- You need to set up a CICS® transaction gateway on a machine to access the server. You also
need to perform some setup work on the CICS server, where you want the CICS program to execute. These steps are not covered; contact
your CICS server administrator
for setup and for connection information to your CICS server.
About this task
After you import the sample, you need to configure the
server and associate the sample with it:
Procedure
- To associate the sample with your CICS server, you need to change the connection
information in the bean implementation class.
- Open up the CustomerImpl.java in a Java™ editor, and change the following
tag to include your CICS server
connection information.
/**
* @j2c.managedConnectionFactory class="com.ibm.connector2.cics.ECIManagedConnectionFactory"
* @j2c.managedConnectionFactory-property name="connectionURL" value="connectionURL"
* @j2c.managedConnectionFactory-property name="password" value="password"
* @j2c.managedConnectionFactory-property name="serverName" value="serverName"
* @j2c.managedConnectionFactory-property name="userName" value="userName"
* @j2c.connectionSpec class="com.ibm.connector2.cics.ECIConnectionSpec"
* @generated
*/
- Note that this example uses the default port 2006. If your
port number is different, you need to add a tag to define the port
number.
- Testing the application using the TestCustomerCommandBean
program: To directly invoke and run the program, you use the TestCustomerCommandBean.java file. You pass in a CustomerNumber,
and then the corresponding CustomerInfo is returned.
- Right-click and select .
Results
You can see the results in the console: