play.db.helper
Class JdbcIterator<T>
java.lang.Object
play.db.helper.JdbcIterator<T>
- All Implemented Interfaces:
- Closeable, Iterable<T>, Iterator<T>
- Direct Known Subclasses:
- JdbcWindowIterator
public class JdbcIterator<T>
- extends Object
- implements Iterator<T>, Iterable<T>, Closeable
Iterate over a JDBC ResultSet
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
factory
protected final JdbcResultFactory<T> factory
result
protected ResultSet result
JdbcIterator
public JdbcIterator(ResultSet result,
JdbcResultFactory<T> factory)
throws SQLException
- Throws:
SQLException
JdbcIterator
public JdbcIterator(ResultSet result,
Class<T> resultClass)
throws SQLException
- Throws:
SQLException
execute
public static <U> JdbcIterator<U> execute(SqlQuery query,
Class<U> resultClass)
execute
public static <U> JdbcIterator<U> execute(SqlQuery query,
JdbcResultFactory<U> factory)
close
public void close()
- Specified by:
close in interface Closeable
close
public static void close(Iterator<?> iterator)
load
protected void load()
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface Iterator<T>
next
public T next()
- Specified by:
next in interface Iterator<T>
remove
public void remove()
- Specified by:
remove in interface Iterator<T>
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly