Interface SQLInterceptor
- All Known Subinterfaces:
SQLConnectionInterceptor
- All Known Implementing Classes:
SafeDelegatingSqlConnectionInterceptor
public interface SQLInterceptor
The
SQLInterceptor is called before and after SQL is to be executed in OFBIZ.-
Method Summary
Modifier and TypeMethodDescriptionvoidafterSuccessfulExecution(String sqlString, List<String> parameterValues, Statement statement, ResultSet resultSet, int rowsUpdated) Deprecated.default voidafterSuccessfulExecution(String sqlString, List<String> parameterValues, List<List<String>> parameterValuesForBatch, Statement statement, ResultSet resultSet, int rowsUpdated, int[] rowsUpdatedByBatch) This is called after a successful (ie noSQLExceptiongenerated) JDBC query is run.voidbeforeExecution(String sqlString, List<String> parameterValues, Statement statement) Deprecated.default voidbeforeExecution(String sqlString, List<String> parameterValues, List<List<String>> parameterValuesForBatch, Statement statement) This is called before an JDBC query is run.voidonException(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException) Deprecated.default voidonException(String sqlString, List<String> parameterValues, List<List<String>> parameterValuesForBatch, Statement statement, SQLException sqlException) This is called if anSQLExceptionis thrown during the JDBC query
-
Method Details
-
beforeExecution
Deprecated.This is called before an JDBC query is run.- Parameters:
sqlString- 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 JDBCStatementin play
-
beforeExecution
default void beforeExecution(String sqlString, List<String> parameterValues, List<List<String>> parameterValuesForBatch, Statement statement) This is called before an JDBC query is run.- Parameters:
sqlString- thw SQL string in playparameterValues- this list of the Java parameters passed to this statement. This is a simple String.valueOf() on these parametersparameterValuesForBatch- this list of list of the Java parameters passed to this statement for batch processing. This is a simple String.valueOf() on these parameters. In case of non batch operation this will be an empty list.statement- the JDBCStatementin play
-
afterSuccessfulExecution
void afterSuccessfulExecution(String sqlString, List<String> parameterValues, Statement statement, ResultSet resultSet, int rowsUpdated) Deprecated.This is called after a successful (ie noSQLExceptiongenerated) JDBC query is run.If this method runs then by design the
onException(String, java.util.List, java.sql.Statement, java.sql.SQLException)will NOT run.- Parameters:
sqlString- 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 JDBCStatementin playresultSet- a JDBCResultSet. 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 -1
-
afterSuccessfulExecution
default void afterSuccessfulExecution(String sqlString, List<String> parameterValues, List<List<String>> parameterValuesForBatch, Statement statement, ResultSet resultSet, int rowsUpdated, int[] rowsUpdatedByBatch) This is called after a successful (ie noSQLExceptiongenerated) JDBC query is run.If this method runs then by design the
onException(String, List, List, Statement, SQLException)will NOT run.- Parameters:
sqlString- the SQL string in playparameterValues- this list of the Java parameters passed to this statement. This is a simple String.valueOf() on these parametersparameterValuesForBatch- this list of list of the Java parameters passed to this statement for batch processing. This is a simple String.valueOf() on these parameters. In case of non batch operation this will be an empty list.statement- the JDBCStatementin playresultSet- a JDBCResultSet. 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 -1rowsUpdatedByBatch- the number of rows updated by batch operation. In case of non batch operation it will be an empty array.
-
onException
void onException(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException) Deprecated.This is called if anSQLExceptionis thrown during the JDBC queryIf this method runs then by design the
afterSuccessfulExecution(String, java.util.List, java.sql.Statement, java.sql.ResultSet, int)will have NOT run.- Parameters:
sqlString- 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 JDBCStatementin playsqlException- the exception that occurred
-
onException
default void onException(String sqlString, List<String> parameterValues, List<List<String>> parameterValuesForBatch, Statement statement, SQLException sqlException) This is called if anSQLExceptionis thrown during the JDBC queryIf this method runs then by design the
afterSuccessfulExecution(String, List, List, Statement, ResultSet, int, int[])will have NOT run.- Parameters:
sqlString- thw SQL string in playparameterValues- this list of the Java parameters passed to this statement. This is a simple String.valueOf() on these parametersparameterValuesForBatch- this list of list of the Java parameters passed to this statement for batch processing. This is a simple String.valueOf() on these parameters. For non batched operations this will be an empty list.statement- the JDBCStatementin playsqlException- the exception that occurred
-
afterSuccessfulExecution(String, List, List, Statement, ResultSet, int, int[])