The Insert Operation - Sun Microsystems SUN SEEBEYOND eWAY User Manual

Adapter for vsam 5.1.3
Table of Contents

Advertisement

Chapter 6
Using VSAM Operations
}
}

The Insert Operation

To perform an insert operation on a table:
1
Execute the insert() method. Assign a field.
2
Insert the row by calling insertRow()
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) {
otdInputDTD_Emp_1.getX_sequence_A( i1 ).getENAME() );
typeConverter.stringToInt( otdInputDTD_Emp_1.getX_sequence_A( i1
).getPHONE(), "#", false, 0 ) );
otdInputDTD_Emp_1.getX_sequence_A( i1 ).getMAILID() );
java.math.BigDecimal( otdInputDTD_Emp_1.getX_sequence_A( i1
).getSALARY() ) );
typeConverter.stringToDouble( otdInputDTD_Emp_1.getX_sequence_A( i1
).getJOBID(), "#.000000;-#.000000", false, 0 ) );
typeConverter.stringToInt( otdInputDTD_Emp_1.getX_sequence_A( i1
).getEMPID(), "#", false, 0 ) );
typeConverter.stringToShort( otdInputDTD_Emp_1.getX_sequence_A( i1
).getDEPTID(), "#", false, 0 ) );
otdInputDTD_Emp_1.getX_sequence_A( i1 ).getDEPARTMENT() );
}
VSAM eWay Adapter User's Guide
otdVSAM_1.getCICSEMP().setENAME(
otdVSAM_1.getCICSEMP().setPHONE(
otdVSAM_1.getCICSEMP().setMAILID(
otdVSAM_1.getCICSEMP().setSALARY( new
otdVSAM_1.getCICSEMP().setJOBID(
otdVSAM_1.getCICSEMP().setEMPID(
otdVSAM_1.getCICSEMP().setDEPTID(
otdVSAM_1.getCICSEMP().setDEPARTMENT(
otdVSAM_1.getCICSEMP().insertRow();
57
VSAM eWay Database Operations (JCD)
Sun Microsytems, Inc.
Section 6.2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sun seebeyond eway 5.1.3

Table of Contents