org.apache.beehive.netui.util.iterator
Class ResultSetIterator

Object
  extended by ResultSetIterator
All Implemented Interfaces:
Iterator

public class ResultSetIterator
extends Object
implements Iterator

Iterator implementation for ResultSet.


Constructor Summary
ResultSetIterator(ResultSet resultSet)
          Create a ResultSetIterator for the resultSet.
 
Method Summary
 boolean hasNext()
          Check for a subsequent item in the ResultSet.
 Object next()
          Advance to the next row in the ResultSet.
 void remove()
          The remove operation is unsupported on the ResultSetIterator.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetIterator

public ResultSetIterator(ResultSet resultSet)
Create a ResultSetIterator for the resultSet.

Parameters:
resultSet - the ResultSet to iterate over
Throws:
IllegalStateException - when a SQLException occurs manipulating the ResultSet
Method Detail

hasNext

public boolean hasNext()
Check for a subsequent item in the ResultSet.

Specified by:
hasNext in interface Iterator
Returns:
true if there is another element; false otherwise
Throws:
IllegalStateException - when a SQLException occurs advancing the ResultSet

next

public Object next()
Advance to the next row in the ResultSet.

Specified by:
next in interface Iterator
Returns:
a Map containing the data in the next row. The keys in the map correspond to the ResultSet's column names and are case insensitive when checking a key.
Throws:
NoSuchElementException - if the ResultSet is null or the end of the ResultSet has been reached

remove

public void remove()
The remove operation is unsupported on the ResultSetIterator.

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - always