org.jooq
Interface ExecuteContext

All Superinterfaces:
Configuration, Serializable

public interface ExecuteContext
extends Configuration

A context object for Query execution passed to registered ExecuteListener's.

Expect most of this context's objects to be nullable!

Author:
Lukas Eder
See Also:
ExecuteListener

Method Summary
 Query[] 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
 String[] 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
 Configuration configuration()
          The configuration wrapped by this context
 Connection getConnection()
          The Connection that is being used for execution.
 Query 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
 Record record()
          The last record that was fetched from the result set, or null if no record has been fetched.
 void record(Record record)
          Calling this has no effect.
 Result<?> result()
          The last result that was fetched from the result set, or null if no result has been fetched.
 void result(Result<?> result)
          Calling this has no effect.
 ResultSet resultSet()
          The ResultSet that is being fetched or null if the result set is unknown or if no result set is being fetched.
 void resultSet(ResultSet resultSet)
          Override the ResultSet that is being fetched.
 Routine<?> routine()
          The jOOQ Routine that is being executed or null if the query is unknown or if there was no jOOQ Routine
 void setConnection(Connection connection)
          Override the Connection that is being used for execution.
 String sql()
          The SQL that is being executed or null if the SQL statement is unknown or if there was no SQL statement
 void sql(String sql)
          Override the SQL statement that is being executed.
 PreparedStatement statement()
          The PreparedStatement that is being executed or null if the statement is unknown or if there was no statement.
 void statement(PreparedStatement statement)
          Override the PreparedStatement that is being executed.
 ExecuteType type()
          The type of database interaction that is being executed
 
Methods inherited from interface org.jooq.Configuration
getData, getData, getDialect, getSchemaMapping, getSettings, setData
 

Method Detail

configuration

Configuration configuration()
The configuration wrapped by this context


type

ExecuteType type()
The type of database interaction that is being executed

See Also:
ExecuteType

query

Query 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

See Also:
routine(), batchQueries()

batchQueries

Query[] 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

Returns:
The executed Query object(s). This is never null
See Also:
query(), routine()

routine

Routine<?> routine()
The jOOQ Routine that is being executed or null if the query is unknown or if there was no jOOQ Routine

See Also:
routine()

sql

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


sql

void sql(String sql)
Override the SQL statement that is being executed. This may have no effect, if called at the wrong moment.

See Also:
ExecuteListener.renderEnd(ExecuteContext), ExecuteListener.prepareStart(ExecuteContext)

batchSQL

String[] 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:
The generated SQL statement(s). This is never null
See Also:
query(), routine()

getConnection

Connection getConnection()
The Connection that is being used for execution.

Specified by:
getConnection in interface Configuration

setConnection

void setConnection(Connection connection)
Override the Connection that is being used for execution. This may have no effect, if called at the wrong moment.

Specified by:
setConnection in interface Configuration
See Also:
ExecuteListener.start(ExecuteContext)

statement

PreparedStatement 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:


statement

void statement(PreparedStatement statement)
Override the PreparedStatement that is being executed. This may have no effect, if called at the wrong moment.

See Also:
ExecuteListener.prepareEnd(ExecuteContext), ExecuteListener.bindStart(ExecuteContext)

resultSet

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


resultSet

void resultSet(ResultSet resultSet)
Override the ResultSet that is being fetched. This may have no effect, if called at the wrong moment.

See Also:
ExecuteListener.executeEnd(ExecuteContext), ExecuteListener.fetchStart(ExecuteContext)

record

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


record

void record(Record record)
Calling this has no effect. It is being used by jOOQ internally.


result

Result<?> result()
The last result that was fetched from the result set, or null if no result has been fetched.


result

void result(Result<?> result)
Calling this has no effect. It is being used by jOOQ internally.



Copyright © 2012. All Rights Reserved.