public class JdbcIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>, java.lang.Iterable<T>, java.io.Closeable
Modifier and Type | Field and Description |
---|---|
protected JdbcResultFactory<T> |
factory |
protected java.sql.ResultSet |
result |
Constructor and Description |
---|
JdbcIterator(java.sql.ResultSet result,
java.lang.Class<T> resultClass) |
JdbcIterator(java.sql.ResultSet result,
JdbcResultFactory<T> factory) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static void |
close(java.util.Iterator<?> iterator) |
static <U> JdbcIterator<U> |
execute(SqlQuery query,
java.lang.Class<U> resultClass) |
static <U> JdbcIterator<U> |
execute(SqlQuery query,
JdbcResultFactory<U> factory) |
boolean |
hasNext() |
java.util.Iterator<T> |
iterator() |
protected void |
load() |
T |
next() |
void |
remove() |
protected final JdbcResultFactory<T> factory
protected java.sql.ResultSet result
public JdbcIterator(java.sql.ResultSet result, JdbcResultFactory<T> factory) throws java.sql.SQLException
java.sql.SQLException
public JdbcIterator(java.sql.ResultSet result, java.lang.Class<T> resultClass) throws java.sql.SQLException
java.sql.SQLException
public static <U> JdbcIterator<U> execute(SqlQuery query, java.lang.Class<U> resultClass)
public static <U> JdbcIterator<U> execute(SqlQuery query, JdbcResultFactory<U> factory)
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public static void close(java.util.Iterator<?> iterator)
protected void load()
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
public void remove()
remove
in interface java.util.Iterator<T>
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly