!--a11y-->
sqlj.runtime.ExecutionContext 
sqlj.runtime.ExecutionContext
An ExecutionContext object provides the execution context in which executable SQL operations are performed. An execution context object contains a number of operations for execution control, execution status, and execution cancellation. Execution control operations modify the semantics of subsequent SQL operations executed on this execution context object. Execution status operations describe the results of the last SQL operation executed on this execution context object.
In Open SQL / SQLJ, statements executed using this class are not batchable. To use batching, statements have to be excuted using the subclass com.sap.sql.BatchExecutionContext.
public static final int ADD_BATCH_COUNT
Constant returned by getUpdateCount() if the last statement encountered was added to the existing statement batch rather than being executed.
public static final int AUTO_BATCH
Constant passed to setBatchLimit() or returned by getBatchLimit(), indicating that implicit batch execution should be performed, and that the actual batch size is at the discretion of the Open SQL / SQLJ runtime.
public static final int EXEC_BATCH_COUNT
Constant returned by getUpdateCount() if the last execution was a statement batch execution.
public static final int EXCEPTION_COUNT
Constant possibly returned by getUpdateCount() indicating that an exception was thrown before the last execution was successfully completed, or that no operation has yet been attempted on this ExecutionContextobject.
public static final int NEW_BATCH_COUNT
Constant returned by getUpdateCount() if the last statement encountered was added to a new statement batch rather than being executed.
public static final int QUERY_COUNT
Constant possibly returned by getUpdateCount() indicating that the last execution produced a result set iterator.
public static final int UNLIMITED_BATCH
Constant passed to setBatchLimit()or returned by getBatchLimit(), indicating that no implicit batch execution should be performed once a certain batch size is reached.
public ExecutionContext ()
This is the default constructor for the ExecutionContext class.
public void cancel () throws SQLException
This method is not supported in Open SQL / SQLJ.
public boolean execute () throws SQLException
This method is for internal use. Application coding shall not call it directly. It can be changed incompatibly at any time.
public synchronized int[] executeBatch ( ) throws SQLException
Batching is not supported in Open SQL / SQLJ for statements executed using the sqlj.runtime.ExecutionContext. To use batching, statements have to be executed via the com.sap.sql.BatchExecutionContext.
public RTResultSet executeQuery () throws SQLException
This method is for internal use. Application coding shall not call it directly. It can be changed incompatibly at any time.
public int executeUpdate () throws SQLException
This method is for internal use. Application coding shall not call it directly. It can be changed incompatibly at any time.
public synchronized int getBatchLimit ()
Batching is not supported in Open SQL / SQLJ for statements executed using the sqlj.runtime.ExecutionContext. To use batching, statements have to be executed via the com.sap.sql.BatchExecutionContext.
public int[] getBatchUpdateCounts ()
Batching is not supported in Open SQL / SQLJ for statements executed using the sqlj.runtime.ExecutionContext. To use batching, statements have to be executed via the com.sap.sql.BatchExecutionContext.
synchronized public int getFetchDirection ( ) throws SQLException
Returns always ResultSetIterator.FETCH_FORWARD.
synchronized public int getFetchSize () throws SQLException
The method returns the number of rows that is the current fetch size for the iterator objects generated from this ExecutionContext object. If this ExecutionContext object has not set a fetch size by calling setFetchSize(), then the value returned is 0. If this ExecutionContext object has set a non-negative fetch size by calling the setFetchSize() method, then the return value is the fetch size specified on setFetchSize().
public synchronized int getMaxFieldSize ()
Setting the maximum field size is not supported in Open SQL / SQLJ. Therefore, this method always returns 0 indicating that the maximum Java field size is unlimited.
public synchronized int getMaxRows ()
Retrieves the maximum number of rows an iterator will return. A value of 0 indicates an unlimited number of rows (the default).
The maximum rows limit is the maximum number of rows that any iterator or JDBC ResultSet returned by SQL operations subsequently executed using this execution context object can contain. By default, the max rows limit is 0 (unlimited).
public synchronized ResultSet getNextResultSet () throws SQLException
This method is not supported in Open SQL / SQLJ.
public synchronized int getQueryTimeout ()
Returns the query timeout limit of SQL operations. The query timeout limit is the maximum number of seconds SQL operations subsequently executed using this ExecutionContext object are permitted to take to complete. If execution of the SQL operation exceeds the limit, an SQLException is thrown. By default, the query timeout limit is 0 (unlimited).
public synchronized int getUpdateCount ()
Returns the update count, defined as the number of rows updated by the last executable SQL operation, to complete execution using this execution context object.
The method returns
· QUERY_COUNT, if the last SQL operation was a query,
· the number of rows modified, if the last SQL operation was a DML statement,
· EXCEPTION_COUNT, if an exception occurred before the last SQL operation completed execution.
Otherwise, the value returned is undefined.
public synchronized SQLWarning getWarnings ()
Returns the first warning reported by the last SQL operation that completed execution using this ExecutionContextobject. Subsequent warnings resulting from the same SQL operation are chained to this SQLWarning. The SQLWarning chain returned represents those warnings that occurred during the execution of the last SQL operation and the subsequent binding of any output host variables. If an iterator is being processed, then all warnings associated with iterator column reads are chained on the iterator object.
public synchronized boolean isBatching ()
Batching is not supported in Open SQL / SQLJ for statements executed using the sqlj.runtime.ExecutionContext. To use batching, statements have to be executed via the com.sap.sql.BatchExecutionContext.
public RTStatement registerStatement(ConnectionContext connCtx, Object profileKey, int stmtNdx) throws SQLException
This method is for internal use. Application coding shall not call it directly. It can be changed incompatibly at any time.
public void releaseStatement () throws SQLException
This method is for internal use. Application coding shall not call it directly. It can be changed incompatibly at any time.
public synchronized void setBatching (boolean doBatch)
Batching is not supported in Open SQL / SQLJ for statements executed using the sqlj.runtime.ExecutionContext. To use batching, statements have to be executed via the com.sap.sql.BatchExecutionContext.
public synchronized void setBatchLimit (int batchLimit)
Batching is not supported in Open SQL / SQLJ for statements executed using the sqlj.runtime.ExecutionContext. To use batching, statements have to be executed via the com.sap.sql.BatchExecutionContext.
public synchronized void setFetchDirection (int direction) throws SQLException
Open SQL / SQLJ does not support scrollable result sets. The fetch direction is always ResultSetIterator.FETCH_FORWARD. This method must not be called with a value other than ResultSetIterator.FETCH_FORWARD.
public synchronized void setMaxFieldSize (int max)
Setting the maximum field size is not supported in Open SQL / SQLJ. The maximum Java field size is always unlimited. This method must not be called with a value other than 0.
public synchronized void setMaxRows (int max)
Sets the maximum number of rows an iterator will return to the value max. A value of 0 indicates an unlimited number of rows (the default).
public synchronized void setQueryTimeout (int seconds)
This method is not supported in Open SQL / SQLJ.