org.apache.commons.dbutils
Interface RowProcessor

All Known Implementing Classes:
BasicRowProcessor

public interface RowProcessor

RowProcessor implementations convert ResultSet rows into various other objects. Implementations can extend BasicRowProcessor to protect themselves from changes to this interface.

Author:
David Graham
See Also:
BasicRowProcessor

Method Summary
 Object[] toArray(ResultSet rs)
          Create an Object[] from the column values in one ResultSet row.
 Object toBean(ResultSet rs, Class type)
          Create a JavaBean from the column values in one ResultSet row.
 List toBeanList(ResultSet rs, Class type)
          Create a List of JavaBeans from the column values in all ResultSet rows.
 Map toMap(ResultSet rs)
          Create a Map from the column values in one ResultSet row.
 

Method Detail

toArray

public Object[] toArray(ResultSet rs)
                 throws SQLException
Create an Object[] from the column values in one ResultSet row. The ResultSet should be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of the ResultSet.

Throws:
SQLException

toBean

public Object toBean(ResultSet rs,
                     Class type)
              throws SQLException
Create a JavaBean from the column values in one ResultSet row. The ResultSet should be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of the ResultSet.

Throws:
SQLException

toBeanList

public List toBeanList(ResultSet rs,
                       Class type)
                throws SQLException
Create a List of JavaBeans from the column values in all ResultSet rows. ResultSet.next() should not be called before passing it to this method.

Returns:
A List of beans with the given type in the order they were returned by the ResultSet.
Throws:
SQLException

toMap

public Map toMap(ResultSet rs)
          throws SQLException
Create a Map from the column values in one ResultSet row. The ResultSet should be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of the ResultSet.

Throws:
SQLException