Prepared Statement; Batch Operations - Sun Microsystems SUN SEEBEYOND eWAY User Manual

Adapter for vsam 5.1.3
Table of Contents

Advertisement

Chapter 6
Using VSAM Operations
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();
}
}

Prepared Statement

6.2.2
A Prepared Statement OTD represents a SQL statement that has been compiled. Fields
in the OTD correspond to the input values that users need to provide.
Prepared statements can be used to perform insert, update, delete and query
operations. A prepared statement uses a question mark (?) as a place holder for input.
For example:
insert into EMP_TAB(Age, Name, Dept No) value(?, ?, ?)
To execute a prepared statement, set the input parameters and call executeUpdate() and
specify the input values if any.
getPrepStatement().getPreparedStatementTest().setAge(23);
getPrepStatement().getPreparedStatementTest().setName('Peter Pan');
getPrepStatement().getPreparedStatementTest().setDeptNo(6);
getPrepStatement().getPreparedStatementTest().executeUpdate();

Batch Operations

6.2.3
To achieve better performance, consider using a bulk insert if you have to insert many
records. This is the "Add Batch" capability. The only modification required is to include
the addBatch() method for each SQL operation and then the executeBatch() call to
submit the batch to the database server. Batch operations apply only to Prepared
Statements.
getPrepStatement().getPreparedStatementTest().setAge(23);
getPrepStatement().getPreparedStatementTest().setName('Peter Pan');
getPrepStatement().getPreparedStatementTest().setDeptNo(6);
getPrepStatement().getPreparedStatementTest().addBatch();
getPrepStatement().getPreparedStatementTest().setAge(45);
getPrepStatement().getPreparedStatementTest().setName('Harrison
Ford');
getPrepStatement().getPreparedStatementTest().setDeptNo(7);
VSAM eWay Adapter User's Guide
VSAM eWay Database Operations (JCD)
59
Section 6.2
Sun Microsytems, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sun seebeyond eway 5.1.3

Table of Contents