Package org.jdbi.v3.core.result
Interface ResultIterator<T>
- All Superinterfaces:
AutoCloseable
,Closeable
,Iterator<T>
- All Known Implementing Classes:
ResultIterable.ResultIteratorDelegate
Represents a forward-only iterator over a result set, which will lazily iterate
the results. The underlying
ResultSet
can be closed by calling the
close()
method.
The default implementation of ResultIterator
will automatically close
the result set after the last element has been retrieved via next()
and
hasNext()
is called (which will return false). This allows for iteration
over the results with automagic resource cleanup.
The remove()
operation is not supported in the default
version, and will raise an UnsupportedOperationException
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the underlying result set.default void
forEachRemaining
(Consumer<? super T> action) Returns the currentStatementContext
.
-
Method Details
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceIterator<T>
-
close
void close()Close the underlying result set.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getContext
StatementContext getContext()Returns the currentStatementContext
.- Returns:
- the current
StatementContext
.
-