站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

MappingSqlQueryWithParameters.ResultReaderImpl (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.jdbc.object
Class MappingSqlQueryWithParameters.ResultReaderImpl

java.lang.Object
  extended by org.springframework.jdbc.object.MappingSqlQueryWithParameters.ResultReaderImpl
All Implemented Interfaces:
ResultReader, RowCallbackHandler
Enclosing class:
MappingSqlQueryWithParameters

protected class MappingSqlQueryWithParameters.ResultReaderImpl
extends Object
implements ResultReader

Implementation of ResultReader that calls the enclosing class's mapRow method for each row.


Constructor Summary
MappingSqlQueryWithParameters.ResultReaderImpl(int rowsExpected, Object[] parameters, Map context)
          Use an array results.
 
Method Summary
 List getResults()
          Return all results, disconnected from the JDBC ResultSet.
 void processRow(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

MappingSqlQueryWithParameters.ResultReaderImpl

public MappingSqlQueryWithParameters.ResultReaderImpl(int rowsExpected,
                                                      Object[] parameters,
                                                      Map context)
Use an array results. More efficient if we know how many results to expect.

Method Detail

processRow

public void processRow(ResultSet rs)
                throws 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; it is only supposed to extract values of the current row.

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
Parameters:
rs - the ResultSet to process (pre-initialized for the current row)
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)

getResults

public 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) 2002-2007 The Spring Framework Project.