| java.lang.Object com.mockrunner.jdbc.AbstractResultSetHandler com.mockrunner.jdbc.AbstractParameterResultSetHandler
All known Subclasses: com.mockrunner.jdbc.AbstractOutParameterResultSetHandler, com.mockrunner.jdbc.PreparedStatementResultSetHandler,
AbstractParameterResultSetHandler | abstract public class AbstractParameterResultSetHandler extends AbstractResultSetHandler (Code) | | Abstract base class for all statement types
that support parameters, i.e. PreparedStatement
and CallableStatement .
|
Inner Class :protected class ParameterWrapper | |
Method Summary | |
public void | addParameterMapForExecutedStatement(String sql, Map parameters) Collects all SQL strings that were executed. | public void | clearGeneratedKeys() Clears the list of statements that return generated keys. | public void | clearResultSets() Clears the ResultSet objects. | public void | clearThrowsSQLException() | public void | clearUpdateCounts() Clears the update counts. | public Map | getExecutedStatementParameter() | public Map | getExecutedStatementParameterMap() Returns the Map of executed SQL strings. | public MockResultSet | getGeneratedKeys(String sql, Map parameters) Returns the first generated keys ResultSet that
matches the specified SQL string. | protected ParameterWrapper | getMatchingParameterWrapper(String sql, Map parameters, Map statementMap) | public ParameterSets | getParametersForExecutedStatement(String sql) Returns the ParameterSets for a specified
SQL string. | public MockResultSet | getResultSet(String sql, Map parameters) Returns the first ResultSet that matches the
specified SQL string and the specified parameters. | public MockResultSet[] | getResultSets(String sql, Map parameters) Returns the first ResultSet[] that matches the
specified SQL string and the specified parameters. | public SQLException | getSQLException(String sql, Map parameters) Returns the SQLException the specified SQL string
should throw. | public boolean | getThrowsSQLException(String sql, Map parameters) Returns if the specified SQL string with the specified parameters
should raise an exception. | public Integer | getUpdateCount(String sql, Map parameters) Returns the first update count that matches the
specified SQL string and the specified parameters. | public Integer[] | getUpdateCounts(String sql, Map parameters) Returns the first update count array that matches the
specified SQL string and the specified parameters. | public boolean | hasMultipleResultSets(String sql, Map parameters) Returns the if the specified SQL string with the specified parameters
returns multiple result sets. | public boolean | hasMultipleUpdateCounts(String sql, Map parameters) Returns the if the specified SQL string with the specified parameters
returns multiple update counts. | public void | prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult, Object[] parameters) Prepare the generated keys ResultSet
for a specified SQL string.
The specified parameters array must contain the parameters in
the correct order starting with index 0 for the first parameter. | public void | prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult, List parameters) Prepare the generated keys ResultSet
for a specified SQL string.
The specified parameters List must contain the
parameters in the correct order starting with index 0 for the first
parameter. | public void | prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult, Map parameters) Prepare the generated keys ResultSet
for a specified SQL string.
The specified parameters Map must contain the parameters by
mapping Integer objects to the corresponding parameter. | public void | prepareResultSet(String sql, MockResultSet resultSet, Object[] parameters) Prepare a ResultSet for a specified SQL string and
the specified parameters. | public void | prepareResultSet(String sql, MockResultSet resultSet, List parameters) Prepare a ResultSet for a specified SQL string and
the specified parameters. | public void | prepareResultSet(String sql, MockResultSet resultSet, Map parameters) Prepare a ResultSet for a specified SQL string and
the specified parameters. | public void | prepareResultSets(String sql, MockResultSet[] resultSets, Object[] parameters) Prepare an array of ResultSet objects for a specified SQL string and
the specified parameters. | public void | prepareResultSets(String sql, MockResultSet[] resultSets, List parameters) Prepare an array of ResultSet objects for a specified SQL string and
the specified parameters. | public void | prepareResultSets(String sql, MockResultSet[] resultSets, Map parameters) Prepare an array of ResultSet objects for a specified SQL string and
the specified parameters. | public void | prepareThrowsSQLException(String sql, Object[] parameters) Prepare that the specified SQL string with the specified parameters
should raise an exception.
This can be used to simulate database exceptions.
This method creates an SQLException and will throw this
exception. | public void | prepareThrowsSQLException(String sql, List parameters) Prepare that the specified SQL string with the specified parameters
should raise an exception.
This can be used to simulate database exceptions.
This method creates an SQLException and will throw this
exception. | public void | prepareThrowsSQLException(String sql, Map parameters) Prepare that the specified SQL string with the specified parameters
should raise an exception.
This can be used to simulate database exceptions.
This method creates an SQLException and will throw this
exception. | public void | prepareThrowsSQLException(String sql, SQLException exc, Object[] parameters) Prepare that the specified SQL string with the specified parameters
should raise an exception.
This can be used to simulate database exceptions.
This method takes an exception object that will be thrown.
The specified parameters array must contain the parameters in
the correct order starting with index 0 for the first parameter. | public void | prepareThrowsSQLException(String sql, SQLException exc, List parameters) Prepare that the specified SQL string with the specified parameters
should raise an exception.
This can be used to simulate database exceptions.
This method takes an exception object that will be thrown.
The specified parameters List must contain the
parameters in the correct order starting with index 0 for the first
parameter. | public void | prepareThrowsSQLException(String sql, SQLException exc, Map parameters) Prepare that the specified SQL string with the specified parameters
should raise an exception.
This can be used to simulate database exceptions.
This method takes an exception object that will be thrown.
The specified parameters Map must contain the parameters by
mapping Integer objects to the corresponding parameter. | public void | prepareUpdateCount(String sql, int updateCount, Object[] parameters) Prepare the update count for execute update calls for a specified SQL string
and the specified parameters. | public void | prepareUpdateCount(String sql, int updateCount, List parameters) Prepare the update count for execute update calls for a specified SQL string
and the specified parameters. | public void | prepareUpdateCount(String sql, int updateCount, Map parameters) Prepare the update count for execute update calls for a specified SQL string
and the specified parameters. | public void | prepareUpdateCounts(String sql, int[] updateCounts, Object[] parameters) Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters. | public void | prepareUpdateCounts(String sql, int[] updateCounts, List parameters) Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters. | public void | prepareUpdateCounts(String sql, int[] updateCounts, Map parameters) Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters. | public void | setExactMatchParameter(boolean exactMatchParameter) Sets if the specified parameters must match exactly
in order and number.
Defaults to false , i.e. |
addParameterMapForExecutedStatement | public void addParameterMapForExecutedStatement(String sql, Map parameters)(Code) | | Collects all SQL strings that were executed.
Parameters: sql - the SQL string Parameters: parameters - a copy of the corresponding parameter map |
clearGeneratedKeys | public void clearGeneratedKeys()(Code) | | Clears the list of statements that return generated keys.
|
clearResultSets | public void clearResultSets()(Code) | | Clears the ResultSet objects.
|
clearThrowsSQLException | public void clearThrowsSQLException()(Code) | | Clears the list of statements that should throw an exception
|
clearUpdateCounts | public void clearUpdateCounts()(Code) | | Clears the update counts.
|
getExecutedStatementParameterMap | public Map getExecutedStatementParameterMap()(Code) | | Returns the Map of executed SQL strings.
Each string maps to the corresponding
ParameterSets object.
the Map of parameters |
getMatchingParameterWrapper | protected ParameterWrapper getMatchingParameterWrapper(String sql, Map parameters, Map statementMap)(Code) | | |
getParametersForExecutedStatement | public ParameterSets getParametersForExecutedStatement(String sql)(Code) | | Returns the ParameterSets for a specified
SQL string.
Parameters: sql - the SQL string the Map of parameters |
setExactMatchParameter | public void setExactMatchParameter(boolean exactMatchParameter)(Code) | | Sets if the specified parameters must match exactly
in order and number.
Defaults to false , i.e. the specified
parameters must be present in the actual parameter
list of the prepared statement with the correct index
but it's ok if there are more actual parameters.
Parameters: exactMatchParameter - must parameters match exactly |
|
|