public class SafeDelegatingSqlConnectionInterceptor extends Object implements SQLConnectionInterceptor
SQLConnectionInterceptor such that the callbacks are guaranteed not to throw
runtime exceptions or linkage errors.| Constructor and Description |
|---|
SafeDelegatingSqlConnectionInterceptor(SQLConnectionInterceptor delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterSuccessfulExecution(String sqlString,
List<String> parameterValues,
Statement statement,
ResultSet resultSet,
int rowsUpdated)
This is called after a successful (ie no
SQLException generated) JDBC query is run. |
void |
beforeExecution(String sqlString,
List<String> parameterValues,
Statement statement)
This is called before an JDBC query is run.
|
void |
onConnectionReplaced(Connection connection,
ConnectionPoolState connectionPoolState)
Called when a connection is returned to the underlying pool
|
void |
onConnectionTaken(Connection connection,
ConnectionPoolState connectionPoolState)
Called when a connection is taken from the underlying pool
|
void |
onException(String sqlString,
List<String> parameterValues,
Statement statement,
SQLException sqlException)
This is called if an
SQLException is thrown during the JDBC query
If this method runs then by design the SQLInterceptor.afterSuccessfulExecution(String, java.util.List,
java.sql.Statement, java.sql.ResultSet, int) (String, java.util.List, java.sql.Statement,
java.sql.SQLException)} will have NOT run. |
public SafeDelegatingSqlConnectionInterceptor(SQLConnectionInterceptor delegate)
public void onConnectionTaken(Connection connection, ConnectionPoolState connectionPoolState)
SQLConnectionInterceptoronConnectionTaken in interface SQLConnectionInterceptorconnection - the connection that has been borrowedconnectionPoolState - info about the connection pool in at the time the connection was takenpublic void onConnectionReplaced(Connection connection, ConnectionPoolState connectionPoolState)
SQLConnectionInterceptoronConnectionReplaced in interface SQLConnectionInterceptorconnection - the connection that has been returnedconnectionPoolState - info about the connection pool in at the time the connection was takenpublic void beforeExecution(String sqlString, List<String> parameterValues, Statement statement)
SQLInterceptorbeforeExecution in interface SQLInterceptorsqlString - thw SQL string in playparameterValues - this list of the Java parameters passed to this statement. This is a simple
String.valueOf() on these parametersstatement - the JDBC Statement in playpublic void afterSuccessfulExecution(String sqlString, List<String> parameterValues, Statement statement, ResultSet resultSet, int rowsUpdated)
SQLInterceptorSQLException generated) JDBC query is run.
If this method runs then by design the SQLInterceptor.onException(String, java.util.List, java.sql.Statement,
java.sql.SQLException) will NOT run.afterSuccessfulExecution in interface SQLInterceptorsqlString - the SQL string in playparameterValues - this list of the Java parameters passed to this statement. This is a simple
String.valueOf() on these parametersstatement - the JDBC Statement in playresultSet - a JDBC ResultSet. In the case of an update, this will be NULL.rowsUpdated - the number of rows updated. In the case of a SELECT, this will be -1public void onException(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException)
SQLInterceptorSQLException is thrown during the JDBC query
If this method runs then by design the SQLInterceptor.afterSuccessfulExecution(String, java.util.List,
java.sql.Statement, java.sql.ResultSet, int) (String, java.util.List, java.sql.Statement,
java.sql.SQLException)} will have NOT run.onException in interface SQLInterceptorsqlString - thw SQL string in playparameterValues - this list of the Java parameters passed to this statement. This is a simple
String.valueOf() on these parametersstatement - the JDBC Statement in playsqlException - the exception that occurredCopyright © 2018 Atlassian. All rights reserved.