/*
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package sample.ims;
import com.ibm.connector2.ims.ico.*;
import javax.resource.cci.*;
/**
*
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class CCIApp {
public static void main(String[] args) {
Connection conn = null;
try{
IMSManagedConnectionFactory mcf = new IMSManagedConnectionFactory();
mcf.setHostName("yourHostName");
mcf.setPortNumber(new Integer(0));
mcf.setDataStoreName("yourDataStoreName");
ConnectionFactory cf = (ConnectionFactory) mcf.createConnectionFactory();
IMSConnectionSpec cSpec = new IMSConnectionSpec();
conn = cf.getConnection(cSpec);
Interaction interAction = conn.createInteraction();
IMSInteractionSpec iSpec = new IMSInteractionSpec();
iSpec.setInteractionVerb(1); // SEND_RECEIVE
iSpec.setImsRequestType(1); // TRANSACTION
iSpec.setCommitMode(1); // SEND_THEN_COMMIT
sample.ims.INPUTMSG input = new INPUTMSG();
input.setIn__ll((short) input.getSize());
input.setIn__zz((short) 0);
input.setIn__trcd("IVTNO");
input.setIn__cmd("DISPLAY");
input.setIn__name1("LAST1");
sample.ims.OUTPUTMSG output = new sample.ims.OUTPUTMSG();
interAction.execute(iSpec, input, output);
System.out.println(
"Output message is... " +
"¥nMSG: " + output.getOut__msg() +
"¥nNAME1: " + output.getOut__name1() +
"¥nNAME2: " + output.getOut__name2() +
"¥nEXTN: " + output.getOut__extn() +
"¥nZIP: " + output.getOut__zip()
);
}
catch (Exception e)
{
System.out.println("Caught exception is: " + e.getMessage());
}
}
}
CCIApp.java は、単純な、二層の非管理 Java アプリケーション・ プログラムです。これは、Rational Application Developer の「CICS/IMS Java データ・バインディング」 ウィザードで作成された Java データ・ バインディング sample.ims.INPUTMSG および sample.ims.OUTPUTMSG を使用します。 ご使用の環境に合わせて CCIApp.java を編集し、setHostName()、setPortNumber()、および setDataStoreName() ステートメントで使用する値を変更します。
Output message is... MSG: ENTRY WAS DISPLAYED NAME1: LAST1 NAME2: FIRST1 EXTN: 8-111-1111 ZIP: D01/R01