public abstract class JdbcEventListener extends Object
src/main/resources/META-INF/services/com.p6spy.engine.event.JdbcEventListener
.
The second way is to implement a P6Factory
NOTE: Exceptions thrown in this event listener won't be caught. So you have to make sure that your event
listener does not throw exceptions. For example, if your onConnectionWrapped(com.p6spy.engine.common.ConnectionInformation)
method throws an exception
your application won't be able to create any Connection
.Constructor and Description |
---|
JdbcEventListener() |
Modifier and Type | Method and Description |
---|---|
void |
onAfterAddBatch(PreparedStatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
Statement.addBatch(String) or
Statement.addBatch(String) method is invoked. |
void |
onAfterAddBatch(StatementInformation statementInformation,
long timeElapsedNanos,
String sql,
SQLException e)
This callback method is executed after the
Statement.addBatch(String) or
Statement.addBatch(String) method is invoked. |
void |
onAfterCallableStatementSet(CallableStatementInformation statementInformation,
String parameterName,
Object value,
SQLException e)
This callback method is executed after any of the
CallableStatement .set* methods are invoked. |
void |
onAfterCommit(ConnectionInformation connectionInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
Connection.commit() method is invoked. |
void |
onAfterConnectionClose(ConnectionInformation connectionInformation,
SQLException e)
This callback method is executed after the
Connection.close() method is invoked. |
void |
onAfterExecute(PreparedStatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after any the
PreparedStatement.execute() methods are invoked. |
void |
onAfterExecute(StatementInformation statementInformation,
long timeElapsedNanos,
String sql,
SQLException e)
This callback method is executed after any the
Statement.execute(String) methods are invoked. |
void |
onAfterExecuteBatch(StatementInformation statementInformation,
long timeElapsedNanos,
int[] updateCounts,
SQLException e)
This callback method is executed after the
Statement.executeBatch() method is invoked. |
void |
onAfterExecuteQuery(PreparedStatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
PreparedStatement.executeQuery() method is invoked. |
void |
onAfterExecuteQuery(StatementInformation statementInformation,
long timeElapsedNanos,
String sql,
SQLException e)
This callback method is executed after the
Statement.executeQuery(String) method is invoked. |
void |
onAfterExecuteUpdate(PreparedStatementInformation statementInformation,
long timeElapsedNanos,
int rowCount,
SQLException e)
This callback method is executed after the
PreparedStatement.executeUpdate() method is invoked. |
void |
onAfterExecuteUpdate(StatementInformation statementInformation,
long timeElapsedNanos,
String sql,
int rowCount,
SQLException e)
This callback method is executed after any of the
Statement.executeUpdate(String) methods are invoked. |
void |
onAfterGetResultSet(StatementInformation statementInformation,
long timeElapsedNanos,
SQLException e)
This callback method is executed after the
Statement.getResultSet() method is invoked. |
void |
onAfterPreparedStatementSet(PreparedStatementInformation statementInformation,
int parameterIndex,
Object value,
SQLException e)
This callback method is executed after any of the
PreparedStatement .set* methods are 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 |
onBeforeAddBatch(PreparedStatementInformation statementInformation)
This callback method is executed before the
PreparedStatement.addBatch() method is invoked. |
void |
onBeforeAddBatch(StatementInformation statementInformation,
String sql)
This callback method is executed before the
Statement.addBatch(String) or
Statement.addBatch(String) method is invoked. |
void |
onBeforeCommit(ConnectionInformation connectionInformation)
This callback method is executed before the
Connection.commit() method is invoked. |
void |
onBeforeExecute(PreparedStatementInformation statementInformation)
This callback method is executed before any of the
PreparedStatement.execute() methods are invoked. |
void |
onBeforeExecute(StatementInformation statementInformation,
String sql)
This callback method is executed before any of the
Statement.execute(String) methods are invoked. |
void |
onBeforeExecuteBatch(StatementInformation statementInformation)
This callback method is executed before the
Statement.executeBatch() method is invoked. |
void |
onBeforeExecuteQuery(PreparedStatementInformation statementInformation)
This callback method is executed before the
PreparedStatement.executeQuery() method is invoked. |
void |
onBeforeExecuteQuery(StatementInformation statementInformation,
String sql)
This callback method is executed before the
Statement.executeQuery(String) method is invoked. |
void |
onBeforeExecuteUpdate(PreparedStatementInformation statementInformation)
This callback method is executed before the
PreparedStatement.executeUpdate() method is invoked. |
void |
onBeforeExecuteUpdate(StatementInformation statementInformation,
String sql)
This callback method is executed before any of the
Statement.executeUpdate(String) methods are invoked. |
void |
onBeforeResultSetNext(ResultSetInformation resultSetInformation)
This callback method is executed before the
ResultSet.next() method is invoked. |
void |
onBeforeRollback(ConnectionInformation connectionInformation)
This callback method is executed before the
Connection.rollback() or the Connection.rollback(Savepoint) method is invoked. |
void |
onConnectionWrapped(ConnectionInformation connectionInformation)
This callback method is executed after a wrapped
Connection has been created. |
public void onConnectionWrapped(ConnectionInformation connectionInformation)
Connection
has been created.
The ConnectionInformation
holds information about the creator of the connection which is either
ConnectionInformation.dataSource
, ConnectionInformation.driver
or
ConnectionInformation.pooledConnection
.connectionInformation
- The meta information about the wrapped Connection
public void onBeforeAddBatch(PreparedStatementInformation statementInformation)
PreparedStatement.addBatch()
method is invoked.statementInformation
- The meta information about the Statement
being invokedpublic void onAfterAddBatch(PreparedStatementInformation statementInformation, long timeElapsedNanos, SQLException e)
Statement.addBatch(String)
or
Statement.addBatch(String)
method is invoked.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 onBeforeAddBatch(StatementInformation statementInformation, String sql)
Statement.addBatch(String)
or
Statement.addBatch(String)
method is invoked.statementInformation
- The meta information about the Statement
being invokedsql
- The SQL string provided to the execute methodpublic void onAfterAddBatch(StatementInformation statementInformation, long timeElapsedNanos, String sql, SQLException e)
Statement.addBatch(String)
or
Statement.addBatch(String)
method is invoked.statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute callsql
- The SQL string provided to the execute methode
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onBeforeExecute(PreparedStatementInformation statementInformation)
PreparedStatement.execute()
methods are invoked.statementInformation
- The meta information about the Statement
being invokedpublic void onAfterExecute(PreparedStatementInformation statementInformation, long timeElapsedNanos, SQLException e)
PreparedStatement.execute()
methods are invoked.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 onBeforeExecute(StatementInformation statementInformation, String sql)
Statement.execute(String)
methods are invoked.statementInformation
- The meta information about the Statement
being invokedsql
- The SQL string provided to the execute methodpublic void onAfterExecute(StatementInformation statementInformation, long timeElapsedNanos, String sql, SQLException e)
Statement.execute(String)
methods are invoked.statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute callsql
- The SQL string provided to the execute methode
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onBeforeExecuteBatch(StatementInformation statementInformation)
Statement.executeBatch()
method is invoked.statementInformation
- The meta information about the Statement
being invokedpublic void onAfterExecuteBatch(StatementInformation statementInformation, long timeElapsedNanos, int[] updateCounts, SQLException e)
Statement.executeBatch()
method is invoked.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 onBeforeExecuteUpdate(PreparedStatementInformation statementInformation)
PreparedStatement.executeUpdate()
method is invoked.statementInformation
- The meta information about the Statement
being invokedpublic void onAfterExecuteUpdate(PreparedStatementInformation statementInformation, long timeElapsedNanos, int rowCount, SQLException e)
PreparedStatement.executeUpdate()
method is invoked.statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute callrowCount
- Either the row count for SQL Data Manipulation Language (DML) statements or 0 for SQL
statements that return nothing or if an exception was throwne
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onBeforeExecuteUpdate(StatementInformation statementInformation, String sql)
Statement.executeUpdate(String)
methods are invoked.statementInformation
- The meta information about the Statement
being invokedsql
- The SQL string provided to the execute methodpublic void onAfterExecuteUpdate(StatementInformation statementInformation, long timeElapsedNanos, String sql, int rowCount, SQLException e)
Statement.executeUpdate(String)
methods are invoked.statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute callsql
- The SQL string provided to the execute methodrowCount
- Either the row count for SQL Data Manipulation Language (DML) statements or 0 for SQL
statements that return nothing or if an exception was throwne
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onBeforeExecuteQuery(PreparedStatementInformation statementInformation)
PreparedStatement.executeQuery()
method is invoked.statementInformation
- The meta information about the Statement
being invokedpublic void onAfterExecuteQuery(PreparedStatementInformation statementInformation, long timeElapsedNanos, SQLException e)
PreparedStatement.executeQuery()
method is invoked.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 onBeforeExecuteQuery(StatementInformation statementInformation, String sql)
Statement.executeQuery(String)
method is invoked.statementInformation
- The meta information about the Statement
being invokedsql
- The SQL string provided to the execute methodpublic void onAfterExecuteQuery(StatementInformation statementInformation, long timeElapsedNanos, String sql, SQLException e)
Statement.executeQuery(String)
method is invoked.statementInformation
- The meta information about the Statement
being invokedtimeElapsedNanos
- The execution time of the execute callsql
- The SQL string provided to the execute methode
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onAfterPreparedStatementSet(PreparedStatementInformation statementInformation, int parameterIndex, Object value, SQLException e)
PreparedStatement
.set* methods are invoked.statementInformation
- The meta information about the Statement
being invokedparameterIndex
- The first parameter 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 onAfterCallableStatementSet(CallableStatementInformation statementInformation, String parameterName, Object value, SQLException e)
CallableStatement
.set* methods are invoked.statementInformation
- The meta information about the Statement
being invokedparameterName
- The name of the parametervalue
- 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 onAfterGetResultSet(StatementInformation statementInformation, long timeElapsedNanos, SQLException e)
Statement.getResultSet()
method is invoked.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 onBeforeResultSetNext(ResultSetInformation resultSetInformation)
ResultSet.next()
method is invoked.resultSetInformation
- The meta information about the ResultSet
being invokedpublic void onAfterResultSetNext(ResultSetInformation resultSetInformation, long timeElapsedNanos, boolean hasNext, SQLException e)
ResultSet.next()
method is invoked.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)
ResultSet.close()
method is invoked.resultSetInformation
- The meta information about the ResultSet
being invokede
- 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)
ResultSet
#get*(String) methods are invoked.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 onAfterResultSetGet(ResultSetInformation resultSetInformation, int columnIndex, Object value, SQLException e)
ResultSet
#get*(int) methods are invoked.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 onBeforeCommit(ConnectionInformation connectionInformation)
Connection.commit()
method is invoked.connectionInformation
- The meta information about the Connection
being invokedpublic void onAfterCommit(ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e)
Connection.commit()
method is invoked.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 onAfterConnectionClose(ConnectionInformation connectionInformation, SQLException e)
Connection.close()
method is invoked.connectionInformation
- The meta information about the Connection
being invokede
- The SQLException
which may be triggered by the call (null
if
there was no exception).public void onBeforeRollback(ConnectionInformation connectionInformation)
Connection.rollback()
or the Connection.rollback(Savepoint)
method is invoked.connectionInformation
- The meta information about the Connection
being invokedpublic void onAfterRollback(ConnectionInformation connectionInformation, long timeElapsedNanos, SQLException e)
Connection.rollback()
or the Connection.rollback(Savepoint)
method is invoked.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).Copyright © 2002-2016 P6Spy. All Rights Reserved.