org.springframework.jdbc.core
Interface ResultSetExtractor

All Known Implementing Classes:
JdbcTemplate.ListResultSetExtractor, JdbcTemplate.ObjectResultSetExtractor, JdbcTemplate.RowCallbackHandlerResultSetExtractor

public interface ResultSetExtractor

Callback interface used by the JdbcTemplate class's doWithResultSetXXXX() methods. Implementations of this interface perform the actual work of extracting results, but don't need to worry about exception handling. SQLExceptions will be caught and handled correctly by the JdbcTemplate class.

This interface is mainly used internally by JdbcTemplate. The RowCallbackHandler is usually a simpler choice for passing to callback methods.

Since:
April 24, 2003
Version:
$Id: ResultSetExtractor.java,v 1.3 2004/03/18 02:46:08 trisberg Exp $
Author:
Rod Johnson
See Also:
JdbcTemplate, RowCallbackHandler

Method Summary
 java.lang.Object extractData(java.sql.ResultSet rs)
          Implementations must implement this method to process all rows in the ResultSet.
 

Method Detail

extractData

public java.lang.Object extractData(java.sql.ResultSet rs)
                             throws java.sql.SQLException
Implementations must implement this method to process all rows in the ResultSet.

Parameters:
rs - ResultSet to extract data from. Implementations should not close this: it will be closed by the JdbcTemplate.
Returns:
an arbitrary result object
Throws:
java.sql.SQLException - if a SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)


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