Called in the event of an exception at any moment of the execution lifecycle.
Available attributes from ExecuteContext
:
- {@link ExecuteContext#connection()}: The connection used for execution
- {@link ExecuteContext#configuration()}: The execution configuration
- {@link ExecuteContext#query()}: The
Query
object, if a jOOQ query is being executed or null
otherwise - {@link ExecuteContext#routine()}: The
Routine
object, if a jOOQ routine is being executed or null
otherwise - {@link ExecuteContext#sql()}: The rendered
SQL
statement that is about to be executed, or null
if the SQL
statement is unknown.. - {@link ExecuteContext#statement()}: The
PreparedStatement
that is about to be executed, or null
if no statement is known to jOOQ. This can be any of the following:
- A
java.sql.PreparedStatement
from your JDBC driver when a jOOQ Query
is being executed as {@link 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 {@link StatementType#STATIC_STATEMENT} - A
java.sql.CallableStatement
when you are executing a jOOQ Routine
Note that the Statement
may be closed! - {@link ExecuteContext#resultSet()}: The
ResultSet
that was fetched or null
, if no result set was fetched. Note that the ResultSet
may already be closed! - {@link ExecuteContext#rows()}: The number of affected rows if applicable.
- {@link ExecuteContext#record()}: The last
Record
that was fetched or null if no records were fetched. - {@link ExecuteContext#result()}: The last set of records that were fetched or null if no records were fetched.
- {@link ExecuteContext#exception()}: The {@link RuntimeException} thatis about to be thrown
- {@link ExecuteContext#sqlException()}: The {@link SQLException} thatwas thrown by the database