com.mockrunner.jdbc
Class AbstractOutParameterResultSetHandler

java.lang.Object
  extended by com.mockrunner.jdbc.AbstractResultSetHandler
      extended by com.mockrunner.jdbc.AbstractParameterResultSetHandler
          extended by com.mockrunner.jdbc.AbstractOutParameterResultSetHandler
Direct Known Subclasses:
CallableStatementResultSetHandler

public abstract class AbstractOutParameterResultSetHandler
extends AbstractParameterResultSetHandler

Abstract base class for all statement types that support out parameters, i.e. CallableStatement.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.mockrunner.jdbc.AbstractParameterResultSetHandler
AbstractParameterResultSetHandler.ParameterWrapper
 
Constructor Summary
AbstractOutParameterResultSetHandler()
           
 
Method Summary
 void clearOutParameter()
          Clears the out parameters.
 java.util.Map getGlobalOutParameter()
          Returns the global out parameter Map.
 boolean getMustRegisterOutParameters()
          Get if out parameter must be registered to be returned.
 java.util.Map getOutParameter(java.lang.String sql)
          Returns the first out parameter Map that matches the specified SQL string.
 java.util.Map getOutParameter(java.lang.String sql, java.util.Map parameters)
          Returns the first out parameter Map that matches the specified SQL string and the specified parameters.
 void prepareGlobalOutParameter(java.util.Map outParameters)
          Prepares the global out parameter Map.
 void prepareOutParameter(java.lang.String sql, java.util.Map outParameters)
          Prepare an out parameter Map for a specified SQL string.
 void prepareOutParameter(java.lang.String sql, java.util.Map outParameters, java.util.List parameters)
          Prepare an out parameter Map for a specified SQL string and the specified parameters.
 void prepareOutParameter(java.lang.String sql, java.util.Map outParameters, java.util.Map parameters)
          Prepare an out parameter Map for a specified SQL string and the specified parameters.
 void prepareOutParameter(java.lang.String sql, java.util.Map outParameters, java.lang.Object[] parameters)
          Prepare an out parameter Map for a specified SQL string and the specified parameters.
 void setMustRegisterOutParameters(boolean mustOutParameterBeRegistered)
          Set if out parameters must be registered to be returned.
 
Methods inherited from class com.mockrunner.jdbc.AbstractParameterResultSetHandler
addParameterMapForExecutedStatement, clearGeneratedKeys, clearResultSets, clearThrowsSQLException, clearUpdateCounts, getExecutedStatementParameter, getExecutedStatementParameterMap, getGeneratedKeys, getMatchingParameterWrapper, getParametersForExecutedStatement, getResultSet, getResultSets, getSQLException, getThrowsSQLException, getUpdateCount, getUpdateCounts, hasMultipleResultSets, hasMultipleUpdateCounts, prepareGeneratedKeys, prepareGeneratedKeys, prepareGeneratedKeys, prepareResultSet, prepareResultSet, prepareResultSet, prepareResultSets, prepareResultSets, prepareResultSets, prepareThrowsSQLException, prepareThrowsSQLException, prepareThrowsSQLException, prepareThrowsSQLException, prepareThrowsSQLException, prepareThrowsSQLException, prepareUpdateCount, prepareUpdateCount, prepareUpdateCount, prepareUpdateCounts, prepareUpdateCounts, prepareUpdateCounts, setExactMatchParameter
 
Methods inherited from class com.mockrunner.jdbc.AbstractResultSetHandler
addExecutedStatement, addReturnedResultSet, addReturnedResultSets, clearGlobalGeneratedKeys, clearGlobalResultSet, clearGlobalUpdateCount, clearReturnsResultSet, createResultSet, createResultSet, createResultSet, createResultSet, getCaseSensitive, getContinueProcessingOnBatchFailure, getExactMatch, getExecutedStatements, getGeneratedKeys, getGeneratedKeysMap, getGlobalGeneratedKeys, getGlobalResultSet, getGlobalResultSets, getGlobalUpdateCount, getGlobalUpdateCounts, getResultSet, getResultSetMap, getResultSets, getReturnedResultSets, getReturnsResultSet, getSQLException, getThrowsSQLException, getUpdateCount, getUpdateCountMap, getUpdateCounts, getUseRegularExpressions, hasMultipleGlobalResultSets, hasMultipleGlobalUpdateCounts, hasMultipleResultSets, hasMultipleUpdateCounts, prepareGeneratedKeys, prepareGlobalGeneratedKeys, prepareGlobalResultSet, prepareGlobalResultSets, prepareGlobalUpdateCount, prepareGlobalUpdateCounts, prepareResultSet, prepareResultSets, prepareReturnsResultSet, prepareThrowsSQLException, prepareThrowsSQLException, prepareUpdateCount, prepareUpdateCounts, setCaseSensitive, setContinueProcessingOnBatchFailure, setExactMatch, setUseRegularExpressions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOutParameterResultSetHandler

public AbstractOutParameterResultSetHandler()
Method Detail

setMustRegisterOutParameters

public void setMustRegisterOutParameters(boolean mustOutParameterBeRegistered)
Set if out parameters must be registered to be returned. The default is false, i.e. if there are matching out parameters prepared, they are returned even if the registerOutParameter methods of CallableStatement have not been called. If set to true, registerOutParameter must be called.

Parameters:
mustOutParameterBeRegistered - must out parameter be registered

getMustRegisterOutParameters

public boolean getMustRegisterOutParameters()
Get if out parameter must be registered to be returned.

Returns:
must out parameter be registered

getOutParameter

public java.util.Map getOutParameter(java.lang.String sql)
Returns the first out parameter Map that matches the specified SQL string. Please note that you can modify the match parameters with AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean).

Parameters:
sql - the SQL string
Returns:
the corresponding out parameter Map

getOutParameter

public java.util.Map getOutParameter(java.lang.String sql,
                                     java.util.Map parameters)
Returns the first out parameter Map that matches the specified SQL string and the specified parameters. Please note that you can modify the match parameters with AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the specified parameter list with AbstractParameterResultSetHandler.setExactMatchParameter(boolean).

Parameters:
sql - the SQL string
parameters - the parameters
Returns:
the corresponding out parameter Map

clearOutParameter

public void clearOutParameter()
Clears the out parameters.


getGlobalOutParameter

public java.util.Map getGlobalOutParameter()
Returns the global out parameter Map.

Returns:
the global out parameter Map

prepareGlobalOutParameter

public void prepareGlobalOutParameter(java.util.Map outParameters)
Prepares the global out parameter Map.

Parameters:
outParameters - the global out parameter Map

prepareOutParameter

public void prepareOutParameter(java.lang.String sql,
                                java.util.Map outParameters)
Prepare an out parameter Map for a specified SQL string. Please note that you can modify the match parameters with AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean).

Parameters:
sql - the SQL string
outParameters - the out parameter Map

prepareOutParameter

public void prepareOutParameter(java.lang.String sql,
                                java.util.Map outParameters,
                                java.lang.Object[] parameters)
Prepare an out parameter Map for a specified SQL string and the specified parameters. The specified parameters array must contain the parameters in the correct order starting with index 0 for the first parameter. Please keep in mind that parameters in CallableStatement objects start with 1 as the first parameter. So parameters[0] maps to the parameter with index 1. Please note that you can modify the match parameters with AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the specified parameter list with AbstractParameterResultSetHandler.setExactMatchParameter(boolean).

Parameters:
sql - the SQL string
outParameters - the corresponding out parameter Map
parameters - the parameters

prepareOutParameter

public void prepareOutParameter(java.lang.String sql,
                                java.util.Map outParameters,
                                java.util.List parameters)
Prepare an out parameter Map for a specified SQL string and the specified parameters. The specified parameters array must contain the parameters in the correct order starting with index 0 for the first parameter. Please keep in mind that parameters in CallableStatement objects start with 1 as the first parameter. So parameters.get(0) maps to the parameter with index 1. Please note that you can modify the match parameters with AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the specified parameter list with AbstractParameterResultSetHandler.setExactMatchParameter(boolean).

Parameters:
sql - the SQL string
outParameters - the corresponding out parameter Map
parameters - the parameters

prepareOutParameter

public void prepareOutParameter(java.lang.String sql,
                                java.util.Map outParameters,
                                java.util.Map parameters)
Prepare an out parameter Map for a specified SQL string and the specified parameters. The specified parameters Map must contain the parameters by mapping Integer or String objects to the corresponding parameter. An Integer object is the index of the parameter. A String is the name of the parameter. Please note that you can modify the match parameters with AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the specified parameter list with AbstractParameterResultSetHandler.setExactMatchParameter(boolean).

Parameters:
sql - the SQL string
outParameters - the corresponding out parameter Map
parameters - the parameters