| Installing Upgrading Designing Configuring Deploying Monitoring Administering Troubleshooting Reference JBI Components | |
| Close Print View | |
| Designing: The Table |
|
Creating a Runtime Environment
Designing Business Processes in the Sun Business Process Manager
Working with TCP/IP HL7 Collaborations
Developing Sun Master Indexes (Repository)
Developing Sun Master Patient Indexes
Developing OTDs for Application Adapters
Developing OTDs for Communication Adapters
Developing OTDs for Database Adapters
Developing OTDs for Web Server Adapters
Designing with Application Adapters
Designing with Communication Adapters
Designing with Web Server Adapters
Designing with Sun JCA Adapters
Defining Constants and Variables
JDBC Adapter Database Operations (BPEL)
JDBC Adapter Database Operations (JCD)
Sybase Adapter Database Operations (BPEL)
Sybase Adapter Database Operations (JCD)
VSAM Adapter Database Operations (BPEL)
VSAM Adapter Database Operations (JCD)
SQL Server Adapter Database Operations (BPEL)
SQL Server Adapter Database Operations (JCD)
DB2 Database Operations (BPEL)
DB2 Connect Adapter Database Operations (BPEL)
DB2 Connect Adapter Database Operations (JCD)
Oracle Adapter Database Operations (BPEL)
Oracle Adapter Outbound XA Support for BPEL
Oracle Adapter Database Operations (JCD)
Long RAW for Prepared Statements and Stored Procedure support:
A table OTD represents a database table. It consists of fields and methods. Fields correspond to the columns of a table while methods are the operations that you can apply to the OTD. This allows you to perform query, update, insert, and delete SQL operations in a table. The ability to update via a resultset is called “Updatable Resultset”, which is a feature supported by this adapter.
By default, the Table OTD has UpdatableConcurrency and ScrollTypeForwardOnly. Normally you do not have to change the default setting.
The type of result returned by the select() method can be specified using:
SetConcurrencytoUpdatable
SetConcurrencytoReadOnly
SetScrollTypetoForwardOnly
SetScrollTypetoScrollSensitive
SetScrollTypetoInsensitive
For example:
package prjVSAM_JCDjcdALL;
public class jcdTableSelect
{
public com.stc.codegen.logger.Logger logger;
public com.stc.codegen.alerter.Alerter alerter;
public com.stc.codegen.util.CollaborationContext collabContext;
public com.stc.codegen.util.TypeConverter typeConverter;
public void receive( com.stc.connector.appconn.file.
FileTextMessage input, otdVSAM.OtdVSAMOTD otdVSAM_1, dtd.
otdOutputDTD_1935483687.Emp otdOutputDTD_Emp_1, com.stc.connector.
appconn.file.FileApplication FileClient_1 )
throws Throwable
{
FileClient_1.setText( "Selecting record(s) from CICSEMP
table via table select .." );
FileClient_1.write();
otdVSAM_1.getCICSEMP().select( input.getText() );
while (otdVSAM_1.getCICSEMP().next()) {
otdOutputDTD_Emp_1.setENAME( otdVSAM_1.getCICSEMP().getENAME() );
otdOutputDTD_Emp_1.setPHONE( typeConverter.intToString( otdVSAM_1.
getCICSEMP().getPHONE(), "#", false, "" ) );
otdOutputDTD_Emp_1.setMAILID( otdVSAM_1.getCICSEMP().getMAILID() );
otdOutputDTD_Emp_1.setSALARY( otdVSAM_1.getCICSEMP().getSALARY().
toString() );
otdOutputDTD_Emp_1.setJOBID( typeConverter.doubleToString(
otdVSAM_1.getCICSEMP().getJOBID(), "#.000000;-#.000000", false, "" ) );
otdOutputDTD_Emp_1.setEMPID( typeConverter.intToString(
otdVSAM_1.getCICSEMP().getEMPID(), "#", false, "" ) );
otdOutputDTD_Emp_1.setDEPTID( typeConverter.shortToString(
otdVSAM_1.getCICSEMP().getDEPTID(), "#", false, "" ) );
otdOutputDTD_Emp_1.setDEPARTMENT( otdVSAM_1.getCICSEMP().getDEPARTMENT() );
FileClient_1.setText( otdOutputDTD_Emp_1.marshalToString() );
FileClient_1.write();
}
FileClient_1.setText( "Done table select." );
FileClient_1.write();
}
}This example inserts an employee record:
package prjVSAM_JCDjcdALL;
public class jcdInsert
{
public com.stc.codegen.logger.Logger logger;
public com.stc.codegen.alerter.Alerter alerter;
public com.stc.codegen.util.CollaborationContext collabContext;
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
{
FileClient_1.setText( "Inserting records into CICSEMP table .." );
FileClient_1.write();
otdInputDTD_Emp_1.unmarshalFromString( input.getText() );
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();
}
FileClient_1.setText( "Done Insert." );
FileClient_1.write();
}
}package prjVSAM_JCDjcdALL;
public class jcdUpdate
{
public com.stc.codegen.logger.Logger logger;
public com.stc.codegen.alerter.Alerter alerter;
public com.stc.codegen.util.CollaborationContext collabContext;
public com.stc.codegen.util.TypeConverter typeConverter;
public void receive( com.stc.connector.appconn.file.FileTextMessage
input, otdVSAM.OtdVSAMOTD otdVSAM_1, dtd.otdOutputDTD_1935483687.
Emp otdOutputDTD_Emp_1, com.stc.connector.appconn.file.FileApplication FileClient_1 )
throws Throwable
{
FileClient_1.setText( "Update the Department .. " );
FileClient_1.write();
otdVSAM_1.getCICSEMP().update( input.getText() );
while (otdVSAM_1.getCICSEMP().next()) {
otdVSAM_1.getCICSEMP().setDEPARTMENT( "QAQAQA" );
otdVSAM_1.getCICSEMP().updateRow();
}
FileClient_1.setText( "Done Update." );
FileClient_1.write();
}
}In this example DELETE an employee.
package prjVSAM_JCDjcdALL;
public class jcdDelete
{
public com.stc.codegen.logger.Logger logger;
public com.stc.codegen.alerter.Alerter alerter;
public com.stc.codegen.util.CollaborationContext collabContext;
public com.stc.codegen.util.TypeConverter typeConverter;
public void receive( com.stc.connector.appconn.file.
FileTextMessage input, otdVSAM.OtdVSAMOTD otdVSAM_1, dtd.
otdOutputDTD_1935483687.Emp otdOutputDTD_Emp_1, com.stc.connector.
appconn.file.FileApplication FileClient_1 )
throws Throwable
{
FileClient_1.setText( "Delete record .." );
FileClient_1.write();
otdVSAM_1.getCICSEMP().delete( input.getText() );
FileClient_1.setText( "Done delete." );
FileClient_1.write();
}
}