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 iterate 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
Modifier and Type | Method and Description |
---|---|
|
close()
|
Methods inherited from interface java.util.Iterator |
---|
hasNext, next, remove |
Method Detail
close
void close()
See Also:
ResultSet
that is associated with theResultIterator
and, if possible, theStatement
that created theResultSet
, freeing all associated JDBC and database resources. This method also marks theResultIterator
as closed.