- All Implemented Interfaces:
- Serializable,- EventListener,- ExecuteListener
ExecuteListener that just logs events to java.util.logging,
 log4j, or slf4j using the JooqLogger- Author:
- Lukas Eder
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbindEnd(ExecuteContext ctx) Called after bind variables to thePreparedStatement.voidexception(ExecuteContext ctx) Called in the event of an exception at any moment of the execution lifecycle.voidexecuteEnd(ExecuteContext ctx) Called after executing a statement.voidCalled before executing a statement.voidfetchEnd(ExecuteContext ctx) Called after fetching data from aResultSet.voidoutEnd(ExecuteContext ctx) Called after fetching out parameter values from aCallableStatement.voidrecordEnd(ExecuteContext ctx) Called after fetching a record from aResultSet.voidrenderEnd(ExecuteContext ctx) Called after rendering SQL from aQueryPart.voidresultEnd(ExecuteContext ctx) Called after fetching a set of records from aResultSet.voidCalled before fetching a set of records from aResultSet.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jooq.ExecuteListenerbindStart, end, fetchStart, outStart, prepareEnd, prepareStart, recordStart, renderStart, start, transformEnd, transformStart, warning
- 
Constructor Details- 
LoggerListenerpublic LoggerListener()
 
- 
- 
Method Details- 
renderEndDescription copied from interface:ExecuteListenerCalled after rendering SQL from aQueryPart.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
 Overridable attributes in ExecuteContext:- ExecuteContext.sql(String): The rendered- SQLstatement that is about to be executed. You can modify this statement freely.
- ExecuteContext.params(Param[]): Bind values that are to be bound to the- PreparedStatement.
 - Specified by:
- renderEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
bindEndDescription copied from interface:ExecuteListenerCalled after bind variables to thePreparedStatement.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
 Overridable attributes in ExecuteContext:- ExecuteContext.statement(PreparedStatement): The- Statement,- PreparedStatement, or- CallableStatementthat is about to be executed. You can modify this statement freely, or wrap- ExecuteContext.statement()with your enriched statement wrapper
 Note that this method is not called when executing queries of type StatementType.STATIC_STATEMENT- Specified by:
- bindEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
executeStartDescription copied from interface:ExecuteListenerCalled before executing a statement.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
 Overridable attributes in ExecuteContext:- ExecuteContext.statement(PreparedStatement): The- Statement,- PreparedStatement, or- CallableStatementthat is about to be executed. You can modify this statement freely, or wrap- ExecuteContext.statement()with your enriched statement wrapper
 Other attributes in ExecuteContext, affected by this lifecycle phase:- ExecuteContext.statementExecutionCount()is incremented.
 - Specified by:
- executeStartin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
recordEndDescription copied from interface:ExecuteListenerCalled after fetching a record from aResultSet.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
- ExecuteContext.resultSet(): The- ResultSetthat is about to be fetched.
- ExecuteContext.record(): The last- Recordthat was fetched.
- ExecuteContext.recordLevel(): The record nesting level, in case the upcoming- ExecuteContext.record()is a- Rowor other type of nested record. The level is also increased if a record is contained in a nested- ExecuteContext.result().
- ExecuteContext.sqlWarning(): The- SQLWarningthat was emitted by the database or- nullif no warning was emitted.
 Note that this method is not called when executing queries that do not return a result, or when executing routines. - Specified by:
- recordEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
resultStartDescription copied from interface:ExecuteListenerCalled before fetching a set of records from aResultSet.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
- ExecuteContext.resultSet(): The- ResultSetthat is about to be fetched.
- ExecuteContext.result(): The set of records that are about to be fetched.
- ExecuteContext.resultLevel(): The result nesting level, in case the upcoming- ExecuteContext.result()is a- DSL.multiset(TableLike)or other type of nested result.
- ExecuteContext.sqlWarning(): The- SQLWarningthat was emitted by the database or- nullif no warning was emitted.
 Executions withoutResultNot all types of execution produce results of type Result. For example, these do not:- ResultQuery.iterator()
- ResultQuery.stream()
- ResultQuery.collect(Collector)(including all- Collectorbased fetches, such as e.g. a- ResultQuery.fetchMap(Field, Field),- ResultQuery.fetchGroups(Field, Field),- ResultQuery.fetchSet(Field), and all the overloads)
- Publisher.subscribe(Subscriber)
 ExecuteListener.resultStart(ExecuteContext)event is fired.Note that this method is also 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.fetchNext()for instance.- Specified by:
- resultStartin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
resultEndDescription copied from interface:ExecuteListenerCalled after fetching a set of records from aResultSet.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
- ExecuteContext.resultSet(): The- ResultSetthat is about to be fetched.
- ExecuteContext.record(): The last- Recordthat was fetched.
- ExecuteContext.result(): The set of records that were fetched.
- ExecuteContext.resultLevel(): The result nesting level, in case the upcoming- ExecuteContext.result()is a- DSL.multiset(TableLike)or other type of nested result.
- ExecuteContext.sqlWarning(): The- SQLWarningthat was emitted by the database or- nullif no warning was emitted.
 Executions withoutResultNot all types of execution produce results of type Result. For example, these do not:- ResultQuery.iterator()
- ResultQuery.stream()
- ResultQuery.collect(Collector)(including all- Collectorbased fetches, such as e.g. a- ResultQuery.fetchMap(Field, Field),- ResultQuery.fetchGroups(Field, Field),- ResultQuery.fetchSet(Field), and all the overloads)
- Publisher.subscribe(Subscriber)
 ExecuteListener.resultEnd(ExecuteContext)event is fired.Note that this method is also 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.fetchNext()for instance.- Specified by:
- resultEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
fetchEndDescription copied from interface:ExecuteListenerCalled after fetching data from aResultSet.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 - Statementis already closed!
- A 
- ExecuteContext.resultSet(): The- ResultSetthat was fetched. Note that the- ResultSetis already closed!
- ExecuteContext.rows(): The number of affected rows if applicable.
- ExecuteContext.serverOutput(): The server output if available. This may be fetched when- Settings.getFetchServerOutputSize()> 0
- ExecuteContext.record(): The last- Recordthat was fetched.
- ExecuteContext.result(): The last set of records that were fetched.
- ExecuteContext.sqlWarning(): The- SQLWarningthat was emitted by the database or- nullif no warning was emitted.
 In case of multiple ResultSetswithResultQuery.fetchMany(), this is called several times, once perResultSetNote that this method is not called when executing queries that do not return a result, or when executing routines. - Specified by:
- fetchEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
executeEndDescription copied from interface:ExecuteListenerCalled after executing a statement.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
- ExecuteContext.resultSet(): The- ResultSetthat is about to be fetched or- null, if the- Queryreturns no result set, or if a- Routineis being executed.
- ExecuteContext.rows(): The number of affected rows if applicable. In case a- ResultSetis fetched, this number is only available at the- ExecuteListener.fetchEnd(ExecuteContext)event.
- ExecuteContext.serverOutput(): The server output if available. This may be fetched when- Settings.getFetchServerOutputSize()> 0
 Overridable attributes in ExecuteContext:- ExecuteContext.resultSet(ResultSet): The- ResultSetthat is about to be fetched. You can modify this result set freely, or wrap- ExecuteContext.resultSet()with your enriched result set wrapper
 - Specified by:
- executeEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
outEndDescription copied from interface:ExecuteListenerCalled after fetching out parameter values from aCallableStatement.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 
- A 
- ExecuteContext.sqlWarning(): The- SQLWarningthat was emitted by the database or- nullif no warning was emitted.
 Note that this method is called only when executing standalone routine calls. - Specified by:
- outEndin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
- 
exceptionDescription copied from interface:ExecuteListenerCalled in the event of an exception at any moment of the execution lifecycle.Available attributes from ExecuteContext:- ExecuteContext.connection(): The connection used for execution
- Scope.configuration(): The execution configuration
- ExecuteContext.query(): The- Queryobject, if a jOOQ query is being executed or- nullotherwise
- ExecuteContext.routine(): The- Routineobject, if a jOOQ routine is being executed or- nullotherwise
- ExecuteContext.sql(): The rendered- SQLstatement that is about to be executed, or- nullif the- SQLstatement is unknown.
- ExecuteContext.params(): The bind values that are bound to the- PreparedStatement.
- ExecuteContext.statement(): The- PreparedStatementthat is about to be executed, or- nullif no statement is known to jOOQ. This can be any of the following:
 
 - A java.sql.PreparedStatementfrom your JDBC driver when a jOOQQueryis being executed asStatementType.PREPARED_STATEMENT
- A java.sql.Statementfrom your JDBC driver wrapped in ajava.sql.PreparedStatementwhen your jOOQQueryis being executed asStatementType.STATIC_STATEMENT
- A java.sql.CallableStatementwhen you are executing a jOOQRoutine
 - Statementmay be closed!
- A 
- ExecuteContext.resultSet(): The- ResultSetthat was fetched or- null, if no result set was fetched. Note that the- ResultSetmay already be closed!
- ExecuteContext.rows(): The number of affected rows if applicable.
- ExecuteContext.serverOutput(): The server output if available. This may be fetched when- Settings.getFetchServerOutputSize()> 0
- ExecuteContext.record(): The last- Recordthat was fetched or null if no records were fetched.
- ExecuteContext.result(): The last set of records that were fetched or null if no records were fetched.
- ExecuteContext.exception(): The- RuntimeExceptionthat is about to be thrown
- ExecuteContext.sqlException(): The- SQLExceptionthat was thrown by the database
 - Specified by:
- exceptionin interface- ExecuteListener
- Parameters:
- ctx- The context containing information about the execution.
 
 
-