Creating the jcdpsselect business rules – Sun Microsystems eWay JDBC/ODBC Adapter User Manual
Page 83
 
Chapter 6
Section 6.5
Implementing the JDBC/ODBC eWay Sample Projects
Building and Deploying the prjJDBC_JCD Sample Project
JDBC/ODBC eWay Adapter User’s Guide
83
Sun Microsystems, Inc.
otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getEmpNo(), "#", 
false, 0 ) );
 otdJDBC_1.getInsert_Ps().setLast_name( 
otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getLastname() );
 otdJDBC_1.getInsert_Ps().setFirst_name( 
otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getFirstname() );
 otdJDBC_1.getInsert_Ps().setRate( new 
java.math.BigDecimal( otdInputDTD_DBemployees_1.getX_sequence_A( i1 
).getRate() ) );
 otdJDBC_1.getInsert_Ps().setLast_update( 
typeConverter.stringToSQLDate( 
otdInputDTD_DBemployees_1.getX_sequence_A( i1 ).getLastDate(), "yyyy-
MM-dd hh:mm:ss", false, "" ) );
 otdJDBC_1.getInsert_Ps().executeUpdate();
\\ Writes a message to confirm the 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
statement query) into the otdInputDTD_DBEmployee OTD and selects all available 
records from the database. The Collaboration also writes a message to 
JCD_PsSelect_output0.dat 
to confirm when records are selected, or when no records
are available.
The jcdPsSelect Collaboration contains the Business Rules displayed in Figure 33.