Class JdbcIterator<T>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<T>, java.util.Iterator<T>
    Direct Known Subclasses:
    JdbcWindowIterator

    public class JdbcIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>, java.lang.Iterable<T>, java.io.Closeable
    Iterate over a JDBC ResultSet
    • Field Detail

      • result

        protected java.sql.ResultSet result
    • Constructor Detail

      • JdbcIterator

        public JdbcIterator​(java.sql.ResultSet result,
                            JdbcResultFactory<T> factory)
                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • JdbcIterator

        public JdbcIterator​(java.sql.ResultSet result,
                            java.lang.Class<T> resultClass)
                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • execute

        public static <U> JdbcIterator<U> execute​(SqlQuery query,
                                                  java.lang.Class<U> resultClass)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • close

        public static void close​(java.util.Iterator<?> iterator)
      • load

        protected void load()
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>