public class JdbcIterator<T> extends Object implements Iterator<T>, Iterable<T>, Closeable
Modifier and Type | Field and Description |
---|---|
protected JdbcResultFactory<T> |
factory |
protected ResultSet |
result |
Constructor and Description |
---|
JdbcIterator(ResultSet result,
Class<T> resultClass) |
JdbcIterator(ResultSet result,
JdbcResultFactory<T> factory) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static void |
close(Iterator<?> iterator) |
static <U> JdbcIterator<U> |
execute(SqlQuery query,
Class<U> resultClass) |
static <U> JdbcIterator<U> |
execute(SqlQuery query,
JdbcResultFactory<U> factory) |
boolean |
hasNext() |
Iterator<T> |
iterator() |
protected void |
load() |
T |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
forEach, spliterator
protected final JdbcResultFactory<T> factory
protected ResultSet result
public JdbcIterator(ResultSet result, JdbcResultFactory<T> factory) throws SQLException
SQLException
public JdbcIterator(ResultSet result, Class<T> resultClass) throws SQLException
SQLException
public static <U> JdbcIterator<U> execute(SqlQuery query, Class<U> resultClass)
public static <U> JdbcIterator<U> execute(SqlQuery query, JdbcResultFactory<U> factory)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public static void close(Iterator<?> iterator)
protected void load()
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly