public class LoggingEventListener extends SimpleJdbcEventListener
src/main/resources/META-INF/services/com.p6spy.engine.logging.LoggingEventListener
.Modifier and Type | Field and Description |
---|---|
static LoggingEventListener |
INSTANCE |
Modifier | Constructor and Description |
---|---|
protected |
LoggingEventListener() |
Modifier and Type | Method and Description |
---|---|
protected void |
logElapsed(Loggable loggable,
long timeElapsedNanos,
Category category,
SQLException e) |
void |
onAfterAnyAddBatch(StatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed before any
Statement .addBatch* method is invoked |
void |
onAfterAnyExecute(StatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after any
Statement .execute* method is invoked |
void |
onAfterCommit(ConnectionInformation connectionInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
Connection.commit() method is invoked. |
void |
onAfterExecuteBatch(StatementInformation statementInformation,
long timeElapsedNanos,
int[] updateCounts,
SQLException e)
This callback method is executed after the
Statement.executeBatch() method is invoked. |
void |
onAfterGetResultSet(StatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
Statement.getResultSet() method is invoked. |
void |
onAfterResultSetClose(ResultSetInformation resultSetInformation,
SQLException e)
This callback method is executed after the
ResultSet.close() method is invoked. |
void |
onAfterResultSetGet(ResultSetInformation resultSetInformation,
int columnIndex,
Object value,
SQLException e)
This callback method is executed after any of the
ResultSet #get*(int) methods are invoked. |
void |
onAfterResultSetGet(ResultSetInformation resultSetInformation,
String columnLabel,
Object value,
SQLException e)
This callback method is executed after any of the
ResultSet #get*(String) methods are invoked. |
void |
onAfterResultSetNext(ResultSetInformation resultSetInformation,
long timeElapsedNanos,
boolean hasNext,
SQLException e)
This callback method is executed after the
ResultSet.next() method is invoked. |
void |
onAfterRollback(ConnectionInformation connectionInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
Connection.rollback() or the Connection.rollback(Savepoint) method is invoked. |
void |
onBeforeResultSetNext(ResultSetInformation resultSetInformation)
This callback method is executed before the
ResultSet.next() method is invoked. |
onAfterAddBatch, onAfterAddBatch, onAfterExecute, onAfterExecute, onAfterExecuteQuery, onAfterExecuteQuery, onAfterExecuteUpdate, onAfterExecuteUpdate, onBeforeAddBatch, onBeforeAddBatch, onBeforeAnyAddBatch, onBeforeAnyExecute, onBeforeExecute, onBeforeExecute, onBeforeExecuteBatch, onBeforeExecuteQuery, onBeforeExecuteQuery, onBeforeExecuteUpdate, onBeforeExecuteUpdate
onAfterCallableStatementSet, onAfterConnectionClose, onAfterPreparedStatementSet, onBeforeCommit, onBeforeRollback
public static final LoggingEventListener INSTANCE
public void onAfterAnyExecute(StatementInformation statementInformation, long timeElapsedNanos, SQLException e)
SimpleJdbcEventListener
Statement
.execute* method is invokedonAfterAnyExecute
in class SimpleJdbcEventListener
statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute calle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterExecuteBatch(StatementInformation statementInformation, long timeElapsedNanos, int[] updateCounts, SQLException e)
JdbcEventListener
Statement.executeBatch()
method is invoked.onAfterExecuteBatch
in class SimpleJdbcEventListener
statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute callupdateCounts
- An array of update counts or null if an exception was throwne
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterCommit(ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e)
JdbcEventListener
Connection.commit()
method is invoked.onAfterCommit
in class JdbcEventListener
connectionInformation
- The meta information about the Connection
being invokedtimeElapsedNanos
- The execution time of the execute calle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterRollback(ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e)
JdbcEventListener
Connection.rollback()
or the Connection.rollback(Savepoint)
method is invoked.onAfterRollback
in class JdbcEventListener
connectionInformation
- The meta information about the Connection
being invokedtimeElapsedNanos
- The execution time of the execute calle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterAnyAddBatch(StatementInformation statementInformation, long timeElapsedNanos, SQLException e)
SimpleJdbcEventListener
Statement
.addBatch* method is invokedonAfterAnyAddBatch
in class SimpleJdbcEventListener
statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute calle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterGetResultSet(StatementInformation statementInformation, long timeElapsedNanos, SQLException e)
JdbcEventListener
Statement.getResultSet()
method is invoked.onAfterGetResultSet
in class JdbcEventListener
statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute calle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterResultSetGet(ResultSetInformation resultSetInformation, int columnIndex, Object value, SQLException e)
JdbcEventListener
ResultSet
#get*(int) methods are invoked.onAfterResultSetGet
in class JdbcEventListener
resultSetInformation
- The meta information about the ResultSet
being invokedcolumnIndex
- the first column is 1, the second is 2, ...value
- the column value; if the value is SQL NULL, the value returned is nulle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterResultSetGet(ResultSetInformation resultSetInformation, String columnLabel, Object value, SQLException e)
JdbcEventListener
ResultSet
#get*(String) methods are invoked.onAfterResultSetGet
in class JdbcEventListener
resultSetInformation
- The meta information about the ResultSet
being invokedcolumnLabel
- The label for the column specified with the SQL AS clause. If the SQL AS clause was
not specified, then the label is the name of the columnvalue
- The column value; if the value is SQL NULL, the value returned is nulle
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onBeforeResultSetNext(ResultSetInformation resultSetInformation)
JdbcEventListener
ResultSet.next()
method is invoked.onBeforeResultSetNext
in class JdbcEventListener
resultSetInformation
- The meta information about the ResultSet
being invokedpublic void onAfterResultSetNext(ResultSetInformation resultSetInformation, long timeElapsedNanos, boolean hasNext, SQLException e)
JdbcEventListener
ResultSet.next()
method is invoked.onAfterResultSetNext
in class JdbcEventListener
resultSetInformation
- The meta information about the ResultSet
being invokedtimeElapsedNanos
- The execution time of the execute callhasNext
- The return value of ResultSet.next()
e
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterResultSetClose(ResultSetInformation resultSetInformation, SQLException e)
JdbcEventListener
ResultSet.close()
method is invoked.onAfterResultSetClose
in class JdbcEventListener
resultSetInformation
- The meta information about the ResultSet
being invokede
- The SQLException
which may be triggered by the call (null
if
there was no exception).protected void logElapsed(Loggable loggable, long timeElapsedNanos, Category category, SQLException e)
Copyright © 2002-2016 P6Spy. All Rights Reserved.