net.sourceforge.sqlunit.test.mock
Class IntrospectingCallableStatementResultSetHandler

java.lang.Object
  extended by com.mockrunner.jdbc.AbstractResultSetHandler
      extended by com.mockrunner.jdbc.AbstractParameterResultSetHandler
          extended by com.mockrunner.jdbc.AbstractOutParameterResultSetHandler
              extended by com.mockrunner.jdbc.CallableStatementResultSetHandler
                  extended by net.sourceforge.sqlunit.test.mock.IntrospectingCallableStatementResultSetHandler

public class IntrospectingCallableStatementResultSetHandler
extends com.mockrunner.jdbc.CallableStatementResultSetHandler

Extends the CallableStatementResultSetHandler to use introspection.

Version:
$Revision: 1.7 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
IntrospectingCallableStatementResultSetHandler(java.lang.String catalog)
          Instantiate a CallableStatementResultSetHandler that depends on Introspection.
 
Method Summary
 java.lang.Object getOutParam(java.lang.String sqlString, int pIndex, int sqlType)
          Returns the result set at the specified index.
 com.mockrunner.mock.jdbc.MockResultSet getResultSet(java.lang.String sqlString)
          Returns the current result set for the SQL call.
 java.lang.Integer getUpdateCount(java.lang.String sqlString)
          Returns the update count for the specified SQL string.
 boolean hasMoreResults(java.lang.String sqlString)
          Returns true of there are more result sets available for this SQL call.
 
Methods inherited from class com.mockrunner.jdbc.CallableStatementResultSetHandler
addCallableStatement, clearCallableStatements, getCallableStatementMap, getCallableStatements
 
Methods inherited from class com.mockrunner.jdbc.AbstractOutParameterResultSetHandler
clearOutParameter, getGlobalOutParameter, getOutParameter, getOutParameter, prepareGlobalOutParameter, prepareOutParameter, prepareOutParameter, prepareOutParameter, prepareOutParameter
 
Methods inherited from class com.mockrunner.jdbc.AbstractParameterResultSetHandler
clearResultSets, clearThrowsSQLException, clearUpdateCounts, doParameterMatch, getResultSet, getThrowsSQLException, getUpdateCount, prepareResultSet, prepareResultSet, prepareResultSet, prepareThrowsSQLException, prepareThrowsSQLException, prepareThrowsSQLException, prepareUpdateCount, prepareUpdateCount, prepareUpdateCount, setExactMatchParameter
 
Methods inherited from class com.mockrunner.jdbc.AbstractResultSetHandler
addExecutedStatement, addReturnedResultSet, clearGlobalResultSet, clearReturnsResultSet, createResultSet, createResultSet, createResultSet, createResultSet, getCaseSensitive, getExactMatch, getExecutedStatements, getGlobalResultSet, getGlobalUpdateCount, getResultSetMap, getReturnedResultSets, getReturnsResultSet, getThrowsSQLException, getUpdateCountMap, prepareGlobalResultSet, prepareGlobalUpdateCount, prepareResultSet, prepareReturnsResultSet, prepareThrowsSQLException, prepareUpdateCount, setCaseSensitive, setExactMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntrospectingCallableStatementResultSetHandler

public IntrospectingCallableStatementResultSetHandler(java.lang.String catalog)
Instantiate a CallableStatementResultSetHandler that depends on Introspection.

Parameters:
catalog - the name of the class to introspect.
Method Detail

getResultSet

public final com.mockrunner.mock.jdbc.MockResultSet getResultSet(java.lang.String sqlString)
Returns the current result set for the SQL call.

Overrides:
getResultSet in class com.mockrunner.jdbc.AbstractResultSetHandler
Parameters:
sqlString - the SQL string to execute.
Returns:
a MockResultSetObject.

hasMoreResults

public final boolean hasMoreResults(java.lang.String sqlString)
                             throws java.sql.SQLException
Returns true of there are more result sets available for this SQL call. Also increments the result set index as a side effect.

Parameters:
sqlString - the SQL string to look up.
Returns:
true if there are more resultsets, false if not.
Throws:
java.sql.SQLException - if an error occurs.

getOutParam

public final java.lang.Object getOutParam(java.lang.String sqlString,
                                          int pIndex,
                                          int sqlType)
                                   throws java.sql.SQLException
Returns the result set at the specified index. No index increment or decrement occurs during this method call. This is useful for pulling out outparams (at negative resultSetIndex positions) that masquerade as resultsets.

Parameters:
sqlString - the SQL string to look up.
pIndex - the parameter index (1-based).
sqlType - the SQL Type of the parameter.
Returns:
the Object at the specified parameter index.
Throws:
java.sql.SQLException - if an error occurs.

getUpdateCount

public final java.lang.Integer getUpdateCount(java.lang.String sqlString)
Returns the update count for the specified SQL string.

Overrides:
getUpdateCount in class com.mockrunner.jdbc.AbstractResultSetHandler
Parameters:
sqlString - the SQL string to look up.
Returns:
an updatecount as an Integer.