|
SAP NetWeaver 7.30 (SP05) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsqlj.runtime.ExecutionContext
com.sap.sql.BatchExecutionContext
public class BatchExecutionContext
The class BatchExecutionContext allows for batching in
Open SQL / SQLJ. In Open SQL / SQLJ, batching is
only possible for statements executed using an instance of this class as
their execution context.
In contrast to batching as specified in the ISO/IEC 9075-10, the
BatchExecutionContext does not perform an implicit execution
of a statement batch, if it is atempted to execute an batch incompatible
statement. Two statements are regarded to be batch compatible iff they have
exactly the same source code position. Typically, batching with
Open SQL / SQLJ will be used in a loop.
Example:
String names[] = { "Hugo", "Emil", Paul", Egon" };
BatchExecutionContext btx = new BatchExecutionContext();
for(int i = 0; i < names.length; i++) {
#sql [ctx, btx] { UPDATE dbtab SET name = :(names[i]) WHERE key = :i };
}
btx.executeBatch();
ExecutionContext,
ExecutionContext.executeBatch()| Field Summary |
|---|
| Fields inherited from class sqlj.runtime.ExecutionContext |
|---|
ADD_BATCH_COUNT, AUTO_BATCH, EXCEPTION_COUNT, EXEC_BATCH_COUNT, NEW_BATCH_COUNT, QUERY_COUNT, UNLIMITED_BATCH |
| Constructor Summary | |
|---|---|
BatchExecutionContext()
Creates a new BatchExecutionContext object. |
|
| Method Summary | |
|---|---|
int |
getBatchLimit()
Returns the current batch limit that was set for this BatchExecutionContext object. |
sqlj.runtime.profile.RTStatement |
registerStatement(ConnectionContext connCtx,
Object profileKey,
int stmtNdx)
This methods is for internal use of the SQLJ runtime an must not be called by an application. |
void |
setBatching(boolean doBatch)
On an BatchExecutionContext object, batching cannot be
switched of. |
void |
setBatchLimit(int batchLimit)
Sets the maximum batch size on this batch context object. |
| Methods inherited from class sqlj.runtime.ExecutionContext |
|---|
cancel, execute, executeBatch, executeQuery, executeUpdate, getBatchUpdateCounts, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getNextResultSet, getQueryTimeout, getUpdateCount, getWarnings, isBatching, releaseStatement, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatchExecutionContext()
BatchExecutionContext object. On the newly
created object, batching is allway switched on and cannot be switched
off.
The batch size is set to ExcutionContext.UNLIMITED_BATCH
ExecutionContext,
ExecutionContext.UNLIMITED_BATCH| Method Detail |
|---|
public void setBatchLimit(int batchLimit)
ExecutionContext.UNLIMITED_BATCH is
specified, the maximum batch size is unlimited, and can not be exceeded.
New BatchExecutionContext objects are always created with
UNLIMITED_BATCH.
batchLimit is specified, an
implict batch execution will be performed, whenever the number of batched
statements reaches batchLimit.
ExecutionContext.AUTO_BATCH is
specified, the maximum batch size is finite but unspecified.
setBatchLimit in class ExecutionContextbatchLimit - ExecutionContext.UNLIMITED_BATCH if the
maximum batch size is unlimited,
ExecutionContext.AUTO_BATCH if the maximum batch size is
finite and implementation dependent, or n > 0 for a maximum
batch size of n.ExecutionContext,
ExecutionContext.UNLIMITED_BATCH,
ExecutionContext.AUTO_BATCHpublic int getBatchLimit()
BatchExecutionContext object.
getBatchLimit in class ExecutionContextExecutionContext.UNLIMITED_BATCH.
ExecutionContext.AUTO_BATCH.
n > 0.
ExecutionContext,
ExecutionContext.UNLIMITED_BATCH,
ExecutionContext.AUTO_BATCHpublic void setBatching(boolean doBatch)
BatchExecutionContext object, batching cannot be
switched of. If this methos is invoked with false, a
runtime exception will be thrown.
setBatching in class ExecutionContextdoBatch - true if batching should be enabled;
false if batching should be disabledBatchExecutionContext
public sqlj.runtime.profile.RTStatement registerStatement(ConnectionContext connCtx,
Object profileKey,
int stmtNdx)
throws SQLException
registerStatement in class ExecutionContextconnCtx - the connection context that contains the profile that
contains the statement to register.profileKey - the key of the connected profile within the
connection context.stmtNdx - the 0-based index of the statement within the profile
to be registered.
SQLException - if the max fields size, max rows, or query timeout cannot be set on
the registered statement.ExecutionContext.releaseStatement(),
ConnectedProfile.getStatement(int, java.util.Map),
ConnectionContext.getConnectedProfile(java.lang.Object)| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] CORE-TOOLS
|
[sap.com]
|
default
|
BC-JAS
|
[sap.com] ENGINEAPI
|
[sap.com]
|
default
|
BC-JAS-PER-SQL
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/opensql/api
|
api
|
BC-JAS
|
|
SAP NetWeaver 7.30 (SP05) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||