Chapter 7
Section 7.6
Implementing the VSAM eWay Sample Projects
Building and Deploying the prjVSAM_JCD Sample Project
VSAM eWay Adapter User’s Guide
100
Sun Microsystems, Inc.
public com.stc.codegen.util.TypeConverter typeConverter;
public void receive( com.stc.connector.appconn.file.FileTextMessage
input, dtd.otdInputDTD_622919076.Emp otdInputDTD_Emp_1,
otdVSAM.OtdVSAMOTD otdVSAM_1,
com.stc.connector.appconn.file.FileApplication FileClient_1 )
throws Throwable
{
\\ Writes out a message stating records are being inserted.
FileClient_1.setText( "Inserting records into CICSEMP table .."
);
FileClient_1.write();
\\ Unmarshals data from the input XML data into the
otdInputDTD_DBEmployees OTD.
otdInputDTD_Emp_1.unmarshalFromString( input.getText() );
\\ Calls the otdVSAM OTD, and inserts multiple records into the
database via a For Loop. The first insert() method opens the table
result set for insert operations, while the insertRow() method
inserts records into the table result set.
otdVSAM_1.getCICSEMP().insert();
for (int i1 = 0; i1 < otdInputDTD_Emp_1.countX_sequence_A();
i1 += 1) {
otdVSAM_1.getCICSEMP().setENAME(
otdInputDTD_Emp_1.getX_sequence_A( i1 ).getENAME() );
otdVSAM_1.getCICSEMP().setPHONE(
typeConverter.stringToInt( otdInputDTD_Emp_1.getX_sequence_A( i1
).getPHONE(), "#", false, 0 ) );
otdVSAM_1.getCICSEMP().setMAILID(
otdInputDTD_Emp_1.getX_sequence_A( i1 ).getMAILID() );
otdVSAM_1.getCICSEMP().setSALARY( new
java.math.BigDecimal( otdInputDTD_Emp_1.getX_sequence_A( i1
).getSALARY() ) );
otdVSAM_1.getCICSEMP().setJOBID(
typeConverter.stringToDouble( otdInputDTD_Emp_1.getX_sequence_A( i1
).getJOBID(), "#.000000;-#.000000", false, 0 ) );
otdVSAM_1.getCICSEMP().setEMPID(
typeConverter.stringToInt( otdInputDTD_Emp_1.getX_sequence_A( i1
).getEMPID(), "#", false, 0 ) );
otdVSAM_1.getCICSEMP().setDEPTID(
typeConverter.stringToShort( otdInputDTD_Emp_1.getX_sequence_A( i1
).getDEPTID(), "#", false, 0 ) );
otdVSAM_1.getCICSEMP().setDEPARTMENT(
otdInputDTD_Emp_1.getX_sequence_A( i1 ).getDEPARTMENT() );
otdVSAM_1.getCICSEMP().insertRow();
\\ Writes a message to confirm an inserted records.
}
FileClient_1.setText( "Done Insert." );
FileClient_1.write();
}
}
Creating the jcdPsSelect Business Rules
The
jcdPsSelect
Collaboration implements the Input Web Service Operation to read the
TriggerPsSelect.in
file. It then copies the database resultset (as noted in the prepared