Top Description Inners Fields Constructors Methods
org.jooq.impl

pack-priv Class DefaultExecuteContext

extends Object
implements ExecuteContext
Class Inheritance
All Implemented Interfaces
org.jooq.ExecuteContext, org.jooq.Scope
Static Imports
java.lang.Boolean.TRUE, org.jooq.conf.SettingsTools.renderLocale, org.jooq.impl.Tools.EMPTY_INT, .Tools.EMPTY_QUERY, .Tools.EMPTY_STRING

A default implementation for the ExecuteContext.
Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final ExecuteContext.BatchMode
private Query[]
private int[]
private String[]
private Connection
pack-priv ConnectionProvider
private final ConverterContext
private final Instant
private final Map<Object, Object>
private final Configuration
private RuntimeException
private static final ThreadLocal<Connection>
private static final ThreadLocal<ExecuteContext>
private static final JooqLogger
private static final JooqLogger
private static final JooqLogger
private final Configuration
private Query
private Record
pack-priv int
private static final ThreadLocal<List<AutoCloseable>>
private Result<?>
pack-priv int
private ResultSet
private final Routine<?>
private int
private String[]
private String
private SQLException
private SQLWarning
private PreparedStatement
private int
private Connection

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
DefaultExecuteContext(Configuration configuration, ExecuteContext.BatchMode batchMode, Query[] batchQueries)

pack-priv
pack-priv
DefaultExecuteContext(Configuration configuration, Routine<?> routine)

private
DefaultExecuteContext(Configuration configuration, ExecuteContext.BatchMode batchMode, Query query, Query[] batchQueries, Routine<?> routine)

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.
private final void
batchQueries0(Query... newQueries)

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.
pack-priv static final void
clean()

Clean up blobs, clobs and the local configuration.

public final Configuration
configuration()

Implements org.jooq.Scope.configuration.

The configuration of the current scope.
public final Connection
connection()

Implements org.jooq.ExecuteContext.connection.

The connection to be used in this execute context.
pack-priv final void
connection(ConnectionProvider provider, Connection c)

Initialise this DefaultExecuteContext with a pre-existing Connection.

public final void
connectionProvider(ConnectionProvider provider)

Implements org.jooq.ExecuteContext.connectionProvider.

Override the Connection that is being used for execution.
public final ConverterContext
public final Instant
creationTime()

Implements org.jooq.Scope.creationTime.

The time, according to Configuration#clock(), when this Scope was created.
public final Map<Object, Object>
data()

Implements org.jooq.Scope.data.

Get all custom data from this Scope.
public final Object
data(Object
A key to identify the custom data
key
)

Implements org.jooq.Scope.data.

Get some custom data from this Scope.
public final Object
data(Object
A key to identify the custom data
key
,
Object
The custom data
value
)

Implements org.jooq.Scope.data.

Set some custom data to this Scope.
public final SQLDialect
dialect()

Implements org.jooq.Scope.dialect.

The SQLDialect wrapped by this context.
public final DSLContext
dsl()

Implements org.jooq.Scope.dsl.

Wrap the configuration() in a DSLContext, providing access to the configuration-contextual DSL to construct executable queries.
public final RuntimeException
public final void
public final SQLDialect
family()

Implements org.jooq.Scope.family.

The SQLDialect#family() wrapped by this context.
pack-priv final void
pack-priv static final Connection
localConnection()

Get the registered connection.

pack-priv static final ExecuteContext
localExecuteContext()

Get the registered ExecuteContext.

pack-priv static final <E extends Exception> void
localExecuteContext(ExecuteContext ctx, ThrowingRunnable<E> runnable)

Run a runnable with a new localExecuteContext().

pack-priv static final <T, E extends Exception> T
localExecuteContext(ExecuteContext ctx, ThrowingSupplier<T, E> supplier)

Run a supplier with a new localExecuteContext().

pack-priv static final Connection
localTargetConnection(Scope scope)

Get the registered connection's "target connection" through Configuration#unwrapperProvider() if applicable.

private final void
logVersionSupport(int majorVersion, int minorVersion, String productVersion)

pack-priv final Configuration
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 void
record(Record r)

Implements org.jooq.ExecuteContext.record.

Calling this has no effect.
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 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).
pack-priv static final void
register(Blob blob)

Register a blob for later cleanup with clean()

pack-priv static final void
register(Clob clob)

Register a clob for later cleanup with clean()

pack-priv static final void
register(SQLXML xml)

Register an xml for later cleanup with clean()

pack-priv static final void
register(Array array)

Register an array for later cleanup with clean()

pack-priv static final void
register(AutoCloseable closeable)

Register a closeable for later cleanup with clean()

public final void
result(Result<?> r)

Implements org.jooq.ExecuteContext.result.

Calling this has no effect.
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 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 void
resultSet(ResultSet rs)

Implements org.jooq.ExecuteContext.resultSet.

Override the ResultSet that is being fetched.
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 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 r)

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 Settings
settings()

Implements org.jooq.Scope.settings.

The settings wrapped by this context.
public final void
sql(String s)

Implements org.jooq.ExecuteContext.sql.

Override the SQL statement that is being executed.
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 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 void
statement(PreparedStatement s)

Implements org.jooq.ExecuteContext.statement.

Override the PreparedStatement that is being executed.
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 int
statementExecutionCount()

Implements org.jooq.ExecuteContext.statementExecutionCount.

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

Implements org.jooq.ExecuteContext.type.

The type of database interaction that is being executed.
pack-priv final DefaultExecuteContext
private final Connection
private final Connection
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait