Chapter 6
Section 6.2
Using VSAM Operations
VSAM eWay Database Operations (JCD)
VSAM eWay Adapter User’s Guide
58
Sun Microsytems, Inc.
FileClient_1.setText( "Done Insert." );
FileClient_1.write();
}
}
The Update Operation
To perform an update operation on a table:
1
Execute the
update()
method.
2
Using a while loop together with
next()
, move to the row that you want to update.
3
Assign updating value(s) to the fields of the table OTD
4
Update the row by calling
updateRow()
.
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();
}
}
The Delete Operation
To perform a delete operation on a table:
1
Execute the
delete()
method.
In this example DELETE an employee.
package prjVSAM_JCDjcdALL;
public class jcdDelete
{