Class SqlParameter.ResultReaderStoredProcImpl

  extended byorg.springframework.jdbc.core.SqlParameter.ResultReaderStoredProcImpl
All Implemented Interfaces:
ResultReader, RowCallbackHandler
Enclosing class:

protected static class SqlParameter.ResultReaderStoredProcImpl
extends java.lang.Object
implements ResultReader

Implementation of ResultReader that calls the supplied RowMapper class's mapRow() method for each row. This class is used by parameters that return a result set - subclasses include SqlOutputParameter and SqlReturnResultSet. This class should also be able to be reused when we implement functionality to retrieve generated keys for insert statements.

Constructor Summary
SqlParameter.ResultReaderStoredProcImpl(int rowsExpected, RowMapper rowMapper)
          Use an array results.
Method Summary
 java.util.List getResults()
          Return all results, disconnected from the JDBC ResultSet.
 void processRow(java.sql.ResultSet rs)
          Implementations must implement this method to process each row of data in the ResultSet.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SqlParameter.ResultReaderStoredProcImpl(int rowsExpected,
                                               RowMapper rowMapper)
Use an array results. More efficient if we know how many results to expect.

Method Detail


public void processRow(java.sql.ResultSet rs)
                throws java.sql.SQLException
Description copied from interface: RowCallbackHandler
Implementations must implement this method to process each row of data in the ResultSet. This method should not call next() on the ResultSet, but extract the current values. Exactly what the implementation chooses to do is up to it; a trivial implementation might simply count rows, while another implementation might build an XML document.

Specified by:
processRow in interface RowCallbackHandler
rs - the ResultSet to process
java.sql.SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)


public java.util.List getResults()
Description copied from interface: ResultReader
Return all results, disconnected from the JDBC ResultSet. Never returns null; returns the empty collection if there were no results.

Specified by:
getResults in interface ResultReader

Copyright (C) 2003-2004 The Spring Framework Project.