beautypg.com

Creating the jcdtableselect business rules – Sun Microsystems eWay JDBC/ODBC Adapter User Manual

Page 85

background image

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

85

Sun Microsystems, Inc.

otdOutputDTD_DBemployee_1.setEmpNo( Integer.toString(
otdJDBC_1.getSelect_ps().get$Select_psResults().getEMP_NO() ) );
otdOutputDTD_DBemployee_1.setLastname(
otdJDBC_1.getSelect_ps().get$Select_psResults().getLAST_NAME() );
otdOutputDTD_DBemployee_1.setFirstname(
otdJDBC_1.getSelect_ps().get$Select_psResults().getFIRST_NAME() );
otdOutputDTD_DBemployee_1.setRate(
otdJDBC_1.getSelect_ps().get$Select_psResults().getRATE().toString()
);
otdOutputDTD_DBemployee_1.setLastDate(
otdJDBC_1.getSelect_ps().get$Select_psResults().getLAST_UPDATE().toSt
ring() );
FileClient_1.setText(
otdOutputDTD_DBemployee_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_DBEmployee

OTD and selects all available records from the database

that meet a certain criteria. The Collaboration also writes a message to
JCD_TableSelect_output0.dat

to confirm when records are selected, or when no

records are available.

Note:

The where clause in the business rule reads the trigger value as a placeholder for
input. This permits you to modify the query to select a specific record. Also note that
all records are selected from the database when the TriggerTableSelect.in file is
empty.

The jcdTableSelect Collaboration contains the Business Rules displayed in Figure 34.