Package tools.jdbc
Class RowIterator
java.lang.Object
tools.jdbc.RowIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<ResultSet>,Iterator<ResultSet>,LoopingIterator<ResultSet>
An Iterator for the ResultSet items.
Usage
new RowIterator(ps).toStream().forEach((RsConsumer)(resultSet) -> {
int value = resultSet.getInt(1);
System.out.println(" value: " + value);
});
- Since:
- 1.86
- Author:
- Pavel Ponec
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface tools.set.LoopingIterator
iterator, toStream
-
Constructor Details
-
RowIterator
-
-
Method Details
-
hasNext
The last checking closes all resources.- Specified by:
hasNextin interfaceIterator<ResultSet>- Throws:
IllegalStateException
-
next
-
close
public void close()Close all resources- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-