Top Description Fields Constructors Methods
org.jooq.impl

pack-priv final Class SimpleExecuteContext

extends AbstractScope
implements ExecuteContext
Class Inheritance
All Implemented Interfaces
org.jooq.ExecuteContext, org.jooq.Scope
Imports
java.sql.Connection, .PreparedStatement, .ResultSet, .SQLException, .SQLWarning, java.util.Map, org.jooq.Configuration, .ConnectionProvider, .ConverterContext, .ExecuteContext, .ExecuteType, .Query, .Record, .Result, .Routine

A simple implementation of ExecuteContext containing configuration() and data() where no actual context is available.
Author
Lukas Eder

Field Summary

Inherited from org.jooq.impl.AbstractScope:
configurationcreationTimedata

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final ExecuteContext.BatchMode
batchMode()

Implements org.jooq.ExecuteContext.batchMode.

The batch execution mode.
public final Query[]
batchQueries()

Implements org.jooq.ExecuteContext.batchQueries.

The jOOQ Query objects that are being executed in batch mode, or empty if the query is unknown or if there was no jOOQ Query.
public final int[]
batchRows()

Implements org.jooq.ExecuteContext.batchRows.

The number of rows that were affected by the last statement executed in batch mode.
public final String[]
batchSQL()

Implements org.jooq.ExecuteContext.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.
public final Connection
connection()

Implements org.jooq.ExecuteContext.connection.

The connection to be used in this execute context.
public final void
connectionProvider(ConnectionProvider connectionProvider)

Implements org.jooq.ExecuteContext.connectionProvider.

Override the Connection that is being used for execution.
public final ConverterContext
public final RuntimeException
public final void
public final Query
query()

Implements org.jooq.ExecuteContext.query.

The jOOQ Query that is being executed, or null if the query is unknown, if it is a batch query, or if there was no jOOQ Query.
public final Record
record()

Implements org.jooq.ExecuteContext.record.

The last record that was fetched from the result set, or null if no record has been fetched.
public final void
record(Record record)

Implements org.jooq.ExecuteContext.record.

Calling this has no effect.
public final int
recordLevel()

Implements org.jooq.ExecuteContext.recordLevel.

The 0-based record nesting level for record(), relevant when nested result events are triggered via ExecuteListener#resultStart(ExecuteContext) and ExecuteListener#resultEnd(ExecuteContext), e.g. in the presence of DSL#multiset(Select).
public final Result<?>
result()

Implements org.jooq.ExecuteContext.result.

The last result that was fetched from the result set, or null if no result has been fetched, including when results do not need to be buffered in a Result type, such as all ResultQuery#collect(Collector) or ResultQuery#iterator() based fetches.
public final void
result(Result<?> result)

Implements org.jooq.ExecuteContext.result.

Calling this has no effect.
public final int
resultLevel()

Implements org.jooq.ExecuteContext.resultLevel.

The 0-based result nesting level for result(), relevant when nested result events are triggered via ExecuteListener#resultStart(ExecuteContext) and ExecuteListener#resultEnd(ExecuteContext), e.g. in the presence of DSL#multiset(Select).
public final ResultSet
resultSet()

Implements org.jooq.ExecuteContext.resultSet.

The ResultSet that is being fetched or null if the result set is unknown or if no result set is being fetched.
public final void
resultSet(ResultSet resultSet)

Implements org.jooq.ExecuteContext.resultSet.

Override the ResultSet that is being fetched.
public final Routine<?>
routine()

Implements org.jooq.ExecuteContext.routine.

The jOOQ Routine that is being executed or null if the query is unknown or if there was no jOOQ Routine.
public final int
rows()

Implements org.jooq.ExecuteContext.rows.

The number of rows that were affected by the last statement.
public final void
rows(int rows)

Implements org.jooq.ExecuteContext.rows.

Calling this has no effect.
public final String[]
serverOutput()

Implements org.jooq.ExecuteContext.serverOutput.

Any server output collected from this statement when Settings#getFetchServerOutputSize() > 0.
public final void
serverOutput(String[] output)

Implements org.jooq.ExecuteContext.serverOutput.

Any server output collected from this statement when Settings#getFetchServerOutputSize() > 0.
public final String
sql()

Implements org.jooq.ExecuteContext.sql.

The SQL that is being executed or null if the SQL statement is unknown or if there was no SQL statement.
public final void
sql(String sql)

Implements org.jooq.ExecuteContext.sql.

Override the SQL statement that is being executed.
public final SQLException
sqlException()

Implements org.jooq.ExecuteContext.sqlException.

The SQLException that was thrown by the database.
public final void
public final SQLWarning
sqlWarning()

Implements org.jooq.ExecuteContext.sqlWarning.

The SQLWarning that was emitted by the database.
public final void
sqlWarning(SQLWarning e)

Implements org.jooq.ExecuteContext.sqlWarning.

Override the SQLWarning being emitted.
public final PreparedStatement
statement()

Implements org.jooq.ExecuteContext.statement.

The PreparedStatement that is being executed or null if the statement is unknown or if there was no statement.
public final void
statement(PreparedStatement statement)

Implements org.jooq.ExecuteContext.statement.

Override the PreparedStatement that is being executed.
public final int
statementExecutionCount()

Implements org.jooq.ExecuteContext.statementExecutionCount.

The number of times this particular statement has been executed.
public final ExecuteType
type()

Implements org.jooq.ExecuteContext.type.

The type of database interaction that is being executed.
Inherited from org.jooq.impl.AbstractScope:
configurationcreationTimedatadatadatadialectdslfamilysettings

Constructor Detail

SimpleExecuteContextback to summary
pack-priv SimpleExecuteContext(Configuration configuration, Map<Object, Object> data)

Method Detail

batchModeback to summary
public final ExecuteContext.BatchMode batchMode()

Implements org.jooq.ExecuteContext.batchMode.

Doc from org.jooq.ExecuteContext.batchMode.

The batch execution mode.

Annotations
@Override
batchQueriesback to summary
public final Query[] batchQueries()

Implements org.jooq.ExecuteContext.batchQueries.

Doc from org.jooq.ExecuteContext.batchQueries.

The jOOQ Query objects that are being executed in batch mode, or empty if the query is unknown or if there was no jOOQ Query.

If a single Query is executed in non-batch mode, this will return an array of length 1, containing that Query

Refer to batchMode() to decide how to interpret this content.

This corresponds to transformedBatchQueries().

Returns:Query[]

The executed Query object(s). This is never null

Annotations
@Override
batchRowsback to summary
public final int[] batchRows()

Implements org.jooq.ExecuteContext.batchRows.

Doc from org.jooq.ExecuteContext.batchRows.

The number of rows that were affected by the last statement executed in batch mode.

If a single Query is executed in non-batch mode, this will return an array of length 1, containing rows()

This returns -1 values if the number of affected rows is not yet available, or if affected rows are not applicable for a given statement.

Returns:int[]

The affected rows. This is never null

Annotations
@Override
batchSQLback to summary
public final String[] batchSQL()

Implements org.jooq.ExecuteContext.batchSQL.

Doc from org.jooq.ExecuteContext.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.

If a single Query is executed in non-batch mode, this will return an array of length 1, containing that Query

Returns:String[]

The generated SQL statement(s). This is never null

Annotations
@Override
connectionback to summary
public final Connection connection()

Implements org.jooq.ExecuteContext.connection.

Doc from org.jooq.ExecuteContext.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:

Annotations
@Override
connectionProviderback to summary
public final void connectionProvider(ConnectionProvider connectionProvider)

Implements org.jooq.ExecuteContext.connectionProvider.

Doc from org.jooq.ExecuteContext.connectionProvider.

Override the Connection that is being used for execution.

This may have no effect, if called at the wrong moment.

Annotations
@Override
converterContextback to summary
public final ConverterContext converterContext()

Implements org.jooq.ExecuteContext.converterContext.

Doc from org.jooq.ExecuteContext.converterContext.

Get a ConverterContext for the scope of this ExecuteContext.

Annotations
@Override
exceptionback to summary
public final RuntimeException exception()

Implements org.jooq.ExecuteContext.exception.

Doc from org.jooq.ExecuteContext.exception.

The RuntimeException being thrown.

Annotations
@Override
exceptionback to summary
public final void exception(RuntimeException e)

Implements org.jooq.ExecuteContext.exception.

Doc from org.jooq.ExecuteContext.exception.

Override the RuntimeException being thrown.

This may have no effect, if called at the wrong moment.

If null is being passed, jOOQ will internally translate the "unavailable" exception to an unspecified DataAccessException.

Annotations
@Override
queryback to summary
public final Query query()

Implements org.jooq.ExecuteContext.query.

Doc from org.jooq.ExecuteContext.query.

The jOOQ Query that is being executed, or null if the query is unknown, if it is a batch query, or if there was no jOOQ Query.

This corresponds to transformedQuery().

Annotations
@Override
recordback to summary
public final Record record()

Implements org.jooq.ExecuteContext.record.

Doc from org.jooq.ExecuteContext.record.

The last record that was fetched from the result set, or null if no record has been fetched.

Annotations
@Override
recordback to summary
public final void record(Record record)

Implements org.jooq.ExecuteContext.record.

Doc from org.jooq.ExecuteContext.record.

Calling this has no effect. It is used by jOOQ internally.

Annotations
@Override
recordLevelback to summary
public final int recordLevel()

Implements org.jooq.ExecuteContext.recordLevel.

Doc from org.jooq.ExecuteContext.recordLevel.

The 0-based record nesting level for record(), relevant when nested result events are triggered via ExecuteListener#resultStart(ExecuteContext) and ExecuteListener#resultEnd(ExecuteContext), e.g. in the presence of DSL#multiset(Select).

Annotations
@Override
resultback to summary
public final Result<?> result()

Implements org.jooq.ExecuteContext.result.

Doc from org.jooq.ExecuteContext.result.

The last result that was fetched from the result set, or null if no result has been fetched, including when results do not need to be buffered in a Result type, such as all ResultQuery#collect(Collector) or ResultQuery#iterator() based fetches.

Annotations
@Override
resultback to summary
public final void result(Result<?> result)

Implements org.jooq.ExecuteContext.result.

Doc from org.jooq.ExecuteContext.result.

Calling this has no effect. It is used by jOOQ internally.

Annotations
@Override
resultLevelback to summary
public final int resultLevel()

Implements org.jooq.ExecuteContext.resultLevel.

Doc from org.jooq.ExecuteContext.resultLevel.

The 0-based result nesting level for result(), relevant when nested result events are triggered via ExecuteListener#resultStart(ExecuteContext) and ExecuteListener#resultEnd(ExecuteContext), e.g. in the presence of DSL#multiset(Select).

Annotations
@Override
resultSetback to summary
public final ResultSet resultSet()

Implements org.jooq.ExecuteContext.resultSet.

Doc from org.jooq.ExecuteContext.resultSet.

The ResultSet that is being fetched or null if the result set is unknown or if no result set is being fetched.

Annotations
@Override
resultSetback to summary
public final void resultSet(ResultSet resultSet)

Implements org.jooq.ExecuteContext.resultSet.

Doc from org.jooq.ExecuteContext.resultSet.

Override the ResultSet that is being fetched.

This may have no effect, if called at the wrong moment.

Annotations
@Override
routineback to summary
public final Routine<?> routine()

Implements org.jooq.ExecuteContext.routine.

Doc from org.jooq.ExecuteContext.routine.

The jOOQ Routine that is being executed or null if the query is unknown or if there was no jOOQ Routine.

Annotations
@Override
rowsback to summary
public final int rows()

Implements org.jooq.ExecuteContext.rows.

Doc from org.jooq.ExecuteContext.rows.

The number of rows that were affected by the last statement.

This returns -1:

Annotations
@Override
rowsback to summary
public final void rows(int rows)

Implements org.jooq.ExecuteContext.rows.

Doc from org.jooq.ExecuteContext.rows.

Calling this has no effect. It is used by jOOQ internally.

Annotations
@Override
serverOutputback to summary
public final String[] serverOutput()

Implements org.jooq.ExecuteContext.serverOutput.

Doc from org.jooq.ExecuteContext.serverOutput.

Any server output collected from this statement when Settings#getFetchServerOutputSize() > 0.

Returns:String[]

The server output. This is never null.

Annotations
@Override
serverOutputback to summary
public final void serverOutput(String[] output)

Implements org.jooq.ExecuteContext.serverOutput.

Doc from org.jooq.ExecuteContext.serverOutput.

Any server output collected from this statement when Settings#getFetchServerOutputSize() > 0.

Annotations
@Override
sqlback to summary
public final String sql()

Implements org.jooq.ExecuteContext.sql.

Doc from org.jooq.ExecuteContext.sql.

The SQL that is being executed or null if the SQL statement is unknown or if there was no SQL statement.

Annotations
@Override
sqlback to summary
public final void sql(String sql)

Implements org.jooq.ExecuteContext.sql.

Doc from org.jooq.ExecuteContext.sql.

Override the SQL statement that is being executed.

This may have no effect, if called at the wrong moment.

Annotations
@Override
sqlExceptionback to summary
public final SQLException sqlException()

Implements org.jooq.ExecuteContext.sqlException.

Doc from org.jooq.ExecuteContext.sqlException.

The SQLException that was thrown by the database.

Annotations
@Override
sqlExceptionback to summary
public final void sqlException(SQLException e)

Implements org.jooq.ExecuteContext.sqlException.

Doc from org.jooq.ExecuteContext.sqlException.

Override the SQLException being thrown.

Any SQLException will be wrapped by jOOQ using an unchecked DataAccessException. To have jOOQ throw your own custom RuntimeException, use exception(RuntimeException) instead. This may have no effect, if called at the wrong moment.

If null is being passed, jOOQ will internally translate the "unavailable" exception to an unspecified DataAccessException.

Annotations
@Override
sqlWarningback to summary
public final SQLWarning sqlWarning()

Implements org.jooq.ExecuteContext.sqlWarning.

Doc from org.jooq.ExecuteContext.sqlWarning.

The SQLWarning that was emitted by the database.

Note that fetching of warnings can be disabled using Settings#isFetchWarnings(), in case of which this property will be null.

Annotations
@Override
sqlWarningback to summary
public final void sqlWarning(SQLWarning e)

Implements org.jooq.ExecuteContext.sqlWarning.

Doc from org.jooq.ExecuteContext.sqlWarning.

Override the SQLWarning being emitted.

Annotations
@Override
statementback to summary
public final PreparedStatement statement()

Implements org.jooq.ExecuteContext.statement.

Doc from org.jooq.ExecuteContext.statement.

The PreparedStatement that is being executed or null if the statement is unknown or if there was no statement.

This can be any of the following:

  • A java.sql.PreparedStatement from your JDBC driver when a jOOQ Query is being executed as StatementType#PREPARED_STATEMENT
  • A java.sql.Statement from your JDBC driver wrapped in a java.sql.PreparedStatement when your jOOQ Query is being executed as StatementType#STATIC_STATEMENT
  • A java.sql.CallableStatement when you are executing a jOOQ Routine
Annotations
@Override
statementback to summary
public final void statement(PreparedStatement statement)

Implements org.jooq.ExecuteContext.statement.

Doc from org.jooq.ExecuteContext.statement.

Override the PreparedStatement that is being executed.

This may have no effect, if called at the wrong moment.

Annotations
@Override
statementExecutionCountback to summary
public final int statementExecutionCount()

Implements org.jooq.ExecuteContext.statementExecutionCount.

Doc from org.jooq.ExecuteContext.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).

Annotations
@Override
typeback to summary
public final ExecuteType type()

Implements org.jooq.ExecuteContext.type.

Doc from org.jooq.ExecuteContext.type.

The type of database interaction that is being executed.

Annotations
@Override