safejdbc
Class ResultSetIterator

java.lang.Object
  |
  +--safejdbc.ResultSetIterator
All Implemented Interfaces:
ResultSetProcessor

public abstract class ResultSetIterator
extends java.lang.Object
implements ResultSetProcessor

An Implementation of the ResultSetIterator interface. This convenience implementation iterates through the entire ResultSet and calls the method forEachRow for each row (pun intended :) ). While that is not the only reasonable way to handle a ResultSet, it is common enough to warrant special support as provided by this class.


Constructor Summary
ResultSetIterator()
           
 
Method Summary
abstract  void forEachRow(java.sql.ResultSet rs)
          This template method is called for each row of the ResultSet.
 void process(java.sql.ResultSet rs)
          This method is called by the framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetIterator

public ResultSetIterator()
Method Detail

forEachRow

public abstract void forEachRow(java.sql.ResultSet rs)
                         throws java.sql.SQLException
This template method is called for each row of the ResultSet. Implement this method to specify how the ResultSet is to be handled.
CAUTION: The methods "close" and "next" MUST not be called on the ResultSet in this method. Iteration and closing of the ResultSet is done by the framework!

process

public final void process(java.sql.ResultSet rs)
                   throws java.sql.SQLException
This method is called by the framework. This method iterates through the ResultSet and calls forEachRow for each row (pun intended).
Specified by:
process in interface ResultSetProcessor


Copyright (c) 2001, 2002 by Jan Hermanns and Arno Haase. All Rights Reserved.