- All Superinterfaces:
- Scope
Query execution passed to registered
 ExecuteListener's.
 
 This type implements Scope and thus has a lifecycle defined by the
 query execution.
 
 The Scope.data() map contents are maintained for the entirety of the
 execution, and are passed along to child Scope types, including e.g.
 
- BindingScope: When passing bind values or reading results.
- Author:
- Lukas Eder
- See Also:
- 
Method SummaryModifier and TypeMethodDescription@NotNull Query @NotNull []The jOOQQueryobjects that are being executed in batch mode, or empty if the query is unknown or if there was no jOOQQuery.int @NotNull []The number of rows that were affected by the last statement executed in batch mode.@NotNull String @NotNull []batchSQL()The generated SQL statements that are being executed in batch mode, or empty if the query is unknown or if there was no SQL statement.The connection to be used in this execute context.voidconnectionProvider(ConnectionProvider connectionProvider) Override theConnectionthat is being used for execution.@Nullable RuntimeExceptionTheRuntimeExceptionbeing thrown.voidOverride theRuntimeExceptionbeing thrown.@Nullable Queryquery()The jOOQQuerythat is being executed ornullif the query is unknown, if it is a batch query, or if there was no jOOQQuery.@Nullable Recordrecord()The last record that was fetched from the result set, ornullif no record has been fetched.voidSet the last record that was fetched from the result set.intThe 0-based record nesting level forrecord(), relevant when nested result events are triggered viaExecuteListener.resultStart(ExecuteContext)andExecuteListener.resultEnd(ExecuteContext), e.g.@Nullable Result<?>result()The last result that was fetched from the result set, ornullif no result has been fetched, including when results do not need to be buffered in aResulttype, such as allResultQuery.collect(Collector)orResultQuery.iterator()based fetches.voidSet the last result that was fetched from the result set.intThe 0-based result nesting level forresult(), relevant when nested result events are triggered viaExecuteListener.resultStart(ExecuteContext)andExecuteListener.resultEnd(ExecuteContext), e.g.@Nullable ResultSetTheResultSetthat is being fetched ornullif the result set is unknown or if no result set is being fetched.voidOverride theResultSetthat is being fetched.@Nullable Routine<?>routine()The jOOQRoutinethat is being executed ornullif the query is unknown or if there was no jOOQRoutine.introws()The number of rows that were affected by the last statement.voidrows(int rows) Set the number of rows that were affected by the last statement.@NotNull String @NotNull []Any server output collected from this statement whenSettings.getFetchServerOutputSize()> 0voidserverOutput(String[] output) Any server output collected from this statement whenSettings.getFetchServerOutputSize()> 0@Nullable Stringsql()The SQL that is being executed ornullif the SQL statement is unknown or if there was no SQL statement.voidOverride the SQL statement that is being executed.@Nullable SQLExceptionTheSQLExceptionthat was thrown by the database.voidOverride theSQLExceptionbeing thrown.@Nullable SQLWarningTheSQLWarningthat was emitted by the database.voidOverride theSQLWarningbeing emitted.@Nullable PreparedStatementThePreparedStatementthat is being executed ornullif the statement is unknown or if there was no statement.voidstatement(PreparedStatement statement) Override thePreparedStatementthat is being executed.intThe number of times this particular statement has been executed.@NotNull ExecuteTypetype()The type of database interaction that is being executed.Methods inherited from interface org.jooq.Scopeconfiguration, creationTime, data, data, data, dialect, dsl, family, settings
- 
Method Details- 
connectionConnection connection()The connection to be used in this execute context.This returns a proxy to the Configuration.connectionProvider()'s supplied connection. This proxy takes care of two things:- It takes care of properly implementing
 Settings.getStatementType()
- It takes care of properly returning a connection to
 ConnectionProvider.release(Connection), once jOOQ can release the connection
 
- It takes care of properly implementing
 
- 
typeThe type of database interaction that is being executed.- See Also:
 
- 
queryThe jOOQQuerythat is being executed ornullif the query is unknown, if it is a batch query, or if there was no jOOQQuery.- See Also:
 
- 
batchQueriesThe jOOQQueryobjects that are being executed in batch mode, or empty if the query is unknown or if there was no jOOQQuery.If a single Queryis executed in non-batch mode, this will return an array of length1, containing thatQuery
- 
routineThe jOOQRoutinethat is being executed ornullif the query is unknown or if there was no jOOQRoutine.- See Also:
 
- 
sqlThe SQL that is being executed ornullif the SQL statement is unknown or if there was no SQL statement.
- 
sqlOverride the SQL statement that is being executed.This may have no effect, if called at the wrong moment. 
- 
batchSQLThe generated SQL statements that are being executed in batch mode, or empty if the query is unknown or if there was no SQL statement.If a single Queryis executed in non-batch mode, this will return an array of length1, containing thatQuery
- 
connectionProviderOverride theConnectionthat is being used for execution.This may have no effect, if called at the wrong moment. - See Also:
 
- 
statementThePreparedStatementthat is being executed ornullif the statement is unknown or if there was no statement.This can be any of the following: 
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
- 
statementOverride thePreparedStatementthat is being executed.This may have no effect, if called at the wrong moment. 
- 
statementExecutionCountint statementExecutionCount()The number of times this particular statement has been executed.Statements that are prepared by jOOQ can be executed multiple times without being closed if Query.keepStatement(boolean)is activated.This value will increment as soon as the statement is about to be executed (at the ExecuteListener.executeStart(ExecuteContext)event).
- 
resultSetTheResultSetthat is being fetched ornullif the result set is unknown or if no result set is being fetched.
- 
resultSetOverride theResultSetthat is being fetched.This may have no effect, if called at the wrong moment. 
- 
recordLevelint recordLevel()The 0-based record nesting level forrecord(), relevant when nested result events are triggered viaExecuteListener.resultStart(ExecuteContext)andExecuteListener.resultEnd(ExecuteContext), e.g. in the presence ofDSL#multiset(Select).
- 
recordThe last record that was fetched from the result set, ornullif no record has been fetched.
- 
recordSet the last record that was fetched from the result set.Users shouldn't call this method, it is used by jOOQ internally. 
- 
rowsint rows()The number of rows that were affected by the last statement.This returns -1:- if the number of affected rows is not yet available (e.g. prior to
 the ExecuteListener.executeEnd(ExecuteContext)event).
- if affected rows are not applicable for the given statement
 (statements that do not produce a JDBC
 Statement.getUpdateCount().
 
- if the number of affected rows is not yet available (e.g. prior to
 the 
- 
rows@Internal void rows(int rows) Set the number of rows that were affected by the last statement.Users shouldn't call this method, it is used by jOOQ internally. 
- 
batchRowsint @NotNull [] batchRows()The number of rows that were affected by the last statement executed in batch mode.If a single Queryis executed in non-batch mode, this will return an array of length1, containingrows()This returns -1values if the number of affected rows is not yet available, or if affected rows are not applicable for a given statement.- Returns:
- The affected rows. This is never null
- See Also:
 
- 
resultLevelint resultLevel()The 0-based result nesting level forresult(), relevant when nested result events are triggered viaExecuteListener.resultStart(ExecuteContext)andExecuteListener.resultEnd(ExecuteContext), e.g. in the presence ofDSL#multiset(Select).
- 
resultThe last result that was fetched from the result set, ornullif no result has been fetched, including when results do not need to be buffered in aResulttype, such as allResultQuery.collect(Collector)orResultQuery.iterator()based fetches.
- 
resultSet the last result that was fetched from the result set.Users shouldn't call this method, it is used by jOOQ internally. 
- 
exceptionTheRuntimeExceptionbeing thrown.
- 
exceptionOverride theRuntimeExceptionbeing thrown.This may have no effect, if called at the wrong moment. If nullis being passed, jOOQ will internally translate the "unavailable" exception to an unspecifiedDataAccessException.
- 
sqlExceptionTheSQLExceptionthat was thrown by the database.
- 
sqlExceptionOverride theSQLExceptionbeing thrown.Any SQLExceptionwill be wrapped by jOOQ using an uncheckedDataAccessException. To have jOOQ throw your own customRuntimeException, useexception(RuntimeException)instead. This may have no effect, if called at the wrong moment.If nullis being passed, jOOQ will internally translate the "unavailable" exception to an unspecifiedDataAccessException.
- 
sqlWarningTheSQLWarningthat was emitted by the database.Note that fetching of warnings can be disabled using Settings.isFetchWarnings(), in case of which this property will benull.
- 
sqlWarningOverride theSQLWarningbeing emitted.
- 
serverOutputAny server output collected from this statement whenSettings.getFetchServerOutputSize()> 0- Returns:
- The server output. This is never null.
 
- 
serverOutputAny server output collected from this statement whenSettings.getFetchServerOutputSize()> 0
 
-