public interface ResultIterator<T> extends Iterator<T>, Closeable
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
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying result set.
|
default void |
forEachRemaining(Consumer<? super T> action) |
StatementContext |
getContext() |
default void forEachRemaining(Consumer<? super T> action)
forEachRemaining
in interface Iterator<T>
void close()
close
in interface AutoCloseable
close
in interface Closeable
StatementContext getContext()
Copyright © 2019. All rights reserved.