public class LoggerListener extends DefaultExecuteListener
ExecuteListener that just logs events to java.util.logging,
log4j, or slf4j using the JooqLogger| Constructor and Description |
|---|
LoggerListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
recordEnd(ExecuteContext ctx)
Called after fetching a record from a
ResultSet
Available attributes from ExecuteContext:
ExecuteContext.getConnection(): The connection used for
execution
ExecuteContext.configuration(): The execution configuration
ExecuteContext.query(): The Query object, if a
jOOQ query is being executed or null otherwise
ExecuteContext.routine(): The Routine object, if
a jOOQ routine is being executed or null otherwise
ExecuteContext.sql(): The rendered SQL statement
that is about to be executed, or null if the
SQL statement is unknown.. |
void |
renderEnd(ExecuteContext ctx)
Called after rendering SQL from a
QueryPart
Available attributes from ExecuteContext:
ExecuteContext.getConnection(): The connection used for
execution
ExecuteContext.configuration(): The execution configuration
ExecuteContext.query(): The Query object, if a
jOOQ query is being executed or null otherwise
ExecuteContext.routine(): The Routine object, if
a jOOQ routine is being executed or null otherwise
ExecuteContext.sql(): The rendered SQL statement
that is about to be executed, or null if the
SQL statement is unknown.. |
void |
resultEnd(ExecuteContext ctx)
Called after fetching a set of records from a
ResultSet
Available attributes from ExecuteContext:
ExecuteContext.getConnection(): The connection used for
execution
ExecuteContext.configuration(): The execution configuration
ExecuteContext.query(): The Query object, if a
jOOQ query is being executed or null otherwise
ExecuteContext.routine(): The Routine object, if
a jOOQ routine is being executed or null otherwise
ExecuteContext.sql(): The rendered SQL statement
that is about to be executed, or null if the
SQL statement is unknown.. |
bindEnd, bindStart, end, exception, executeEnd, executeStart, fetchEnd, fetchStart, prepareEnd, prepareStart, recordStart, renderStart, resultStart, startpublic void renderEnd(ExecuteContext ctx)
ExecuteListenerQueryPart
Available attributes from ExecuteContext:
ExecuteContext.getConnection(): The connection used for
executionExecuteContext.configuration(): The execution configurationExecuteContext.query(): The Query object, if a
jOOQ query is being executed or null otherwiseExecuteContext.routine(): The Routine object, if
a jOOQ routine is being executed or null otherwiseExecuteContext.sql(): The rendered SQL statement
that is about to be executed, or null if the
SQL statement is unknown..
Overridable attributes in ExecuteContext:
ExecuteContext.sql(String): The rendered SQL
statement that is about to be executed. You can modify this statement
freely.renderEnd in interface ExecuteListenerrenderEnd in class DefaultExecuteListenerpublic void recordEnd(ExecuteContext ctx)
ExecuteListenerResultSet
Available attributes from ExecuteContext:
ExecuteContext.getConnection(): The connection used for
executionExecuteContext.configuration(): The execution configurationExecuteContext.query(): The Query object, if a
jOOQ query is being executed or null otherwiseExecuteContext.routine(): The Routine object, if
a jOOQ routine is being executed or null otherwiseExecuteContext.sql(): The rendered SQL statement
that is about to be executed, or null if the
SQL statement is unknown..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: java.sql.PreparedStatement from your JDBC driver when
a jOOQ Query is being executed as
StatementType.PREPARED_STATEMENTjava.sql.Statement from your JDBC driver wrapped in a
java.sql.PreparedStatement when your jOOQ Query
is being executed as StatementType.STATIC_STATEMENTjava.sql.CallableStatement when you are executing a
jOOQ RoutineExecuteContext.resultSet(): The ResultSet that
is about to be fetched.ExecuteContext.record(): The last Record that
was fetched.Note that this method is not called when executing queries that do not return a result, or when executing routines.
recordEnd in interface ExecuteListenerrecordEnd in class DefaultExecuteListenerpublic void resultEnd(ExecuteContext ctx)
ExecuteListenerResultSet
Available attributes from ExecuteContext:
ExecuteContext.getConnection(): The connection used for
executionExecuteContext.configuration(): The execution configurationExecuteContext.query(): The Query object, if a
jOOQ query is being executed or null otherwiseExecuteContext.routine(): The Routine object, if
a jOOQ routine is being executed or null otherwiseExecuteContext.sql(): The rendered SQL statement
that is about to be executed, or null if the
SQL statement is unknown..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: java.sql.PreparedStatement from your JDBC driver when
a jOOQ Query is being executed as
StatementType.PREPARED_STATEMENTjava.sql.Statement from your JDBC driver wrapped in a
java.sql.PreparedStatement when your jOOQ Query
is being executed as StatementType.STATIC_STATEMENTjava.sql.CallableStatement when you are executing a
jOOQ RoutineExecuteContext.resultSet(): The ResultSet that
is about to be fetched.ExecuteContext.record(): The last Record that
was fetched.ExecuteContext.result(): The set of records that were
fetched.
Note that this method is not called when executing queries that do not
return a result, or when executing routines. This is also not called when
fetching single records, with Cursor.fetchOne() for instance.
resultEnd in interface ExecuteListenerresultEnd in class DefaultExecuteListenerCopyright © 2013. All Rights Reserved.