com.ibm.pdq.runtime
Interface ResultIterator<T>

All Superinterfaces:
Iterator<T>

public interface ResultIterator<T>
extends Iterator<T>

The implementation of Iterator in which pureQuery returns the query results of an SQL statement when the query results are to be returned as an Iterator<T>. Each call to Iterator.next() returns the contents of one row of the results.

If a user iterates through the entire contents of a returned instance of Iterator<T>, then the instance is closed automatically, and the associated JDBC and database resources are closed as a result. If the user does not interate through the entire contents, then he or she must close the Iterator<T> instance by calling ResultIterator.close(). Because pureQuery methods return Iterator<T>, not the more explicit ResultIterator<T>, the user needs to cast the returned instance as an instance of ResultIterator<T> and then call the close method on the instance.


Method Summary

Method Summary
Return Data TypeMethod Name and Description
void close()
Closes the ResultSet that is associated with the ResultIterator and, if possible, the Statement that created the ResultSet, freeing all associated JDBC and database resources.

Methods inherited from interface java.util.Iterator
hasNext, next, remove

Method Detail

close

void close()
Closes the ResultSet that is associated with the ResultIterator and, if possible, the Statement that created the ResultSet, freeing all associated JDBC and database resources. This method also marks the ResultIterator as closed.
See Also:
ResultSet.close(), Statement.close()