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
102
Sun Microsystems, Inc.
FileClient_1.setText( "Selecting record(s) from CICSEMP table
via Prepared Statement select .." );
\\ Copies the database resultset into the otdInputDTD_DBEmployee OTD
and selects all available records from the database. The
executeQuery() method executes the prepared statement query, while
the resultsAvailable() method ensures all rows are retrieved in the
while loop.
FileClient_1.write();
otdVSAM_1.getSelect_ps().setENAME( "" );
otdVSAM_1.getSelect_ps().executeQuery();
if (otdVSAM_1.getSelect_ps().resultsAvailable()) {
while
(otdVSAM_1.getSelect_ps().get$Select_psResults().next()) {
otdOutputDTD_Emp_1.setENAME(
otdVSAM_1.getSelect_ps().get$Select_psResults().getENAME() );
otdOutputDTD_Emp_1.setPHONE(
typeConverter.intToString(
otdVSAM_1.getSelect_ps().get$Select_psResults().getPHONE(), "#",
false, "" ) );
otdOutputDTD_Emp_1.setMAILID(
otdVSAM_1.getSelect_ps().get$Select_psResults().getMAILID() );
otdOutputDTD_Emp_1.setSALARY(
otdVSAM_1.getSelect_ps().get$Select_psResults().getSALARY().toString(
) );
otdOutputDTD_Emp_1.setJOBID(
typeConverter.doubleToString(
otdVSAM_1.getSelect_ps().get$Select_psResults().getJOBID(),
"#.000000;-#.000000", false, "" ) );
otdOutputDTD_Emp_1.setEMPID(
typeConverter.intToString(
otdVSAM_1.getSelect_ps().get$Select_psResults().getEMPID(), "#",
false, "" ) );
otdOutputDTD_Emp_1.setDEPTID(
typeConverter.shortToString(
otdVSAM_1.getSelect_ps().get$Select_psResults().getDEPTID(), "#",
false, "" ) );
otdOutputDTD_Emp_1.setDEPARTMENT(
otdVSAM_1.getSelect_ps().get$Select_psResults().getDEPARTMENT() );
FileClient_1.setText(
otdOutputDTD_Emp_1.marshalToString() );
FileClient_1.write();
}
} else {
FileClient_1.setText( "No record found!" );
FileClient_1.write();
}
\\ Writes a message to JCD_PsSelect_output0.dat to confirm when
records are selected, or when no records are available.
FileClient_1.setText( "Done Select." );
FileClient_1.write();
}
}
Creating the jcdTableSelect Business Rules
The
jcdTableSelect
Collaboration implements the Input Web Service Operation to read
the
TriggerTableSelect.in
file. It then copies the database resultset into the
otdInputDTD_CICSEMP
OTD and selects all available records from the database that