javatools.db
Class DbIterator

java.lang.Object
  |
  +--javatools.db.DbIterator
All Implemented Interfaces:
java.util.Iterator

public class DbIterator
extends java.lang.Object
implements java.util.Iterator

An iterator class for DbTables. There is no public constructor. Use DbTable.iterator(). While this class supports the java.util.Iterator interface, it is recommended not to use it because they do not throw the proper DbException on error. Instead use the similar hasNextRow() and nextRow().


Field Summary
(package private)  DbRow last
           
(package private)  DbException lastException
           
(package private)  java.sql.ResultSet rs
           
(package private)  DbTable table
           
 
Constructor Summary
(package private) DbIterator(DbTable table)
           
 
Method Summary
(package private)  boolean getNext()
           
 boolean hasNext()
           
 boolean hasNextRow()
          Are there more rows to iterator through?
 java.lang.Object next()
           
 DbRow nextRow()
          Get the next DbRow in the table.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

DbTable table

lastException

DbException lastException

last

DbRow last

rs

java.sql.ResultSet rs
Constructor Detail

DbIterator

DbIterator(DbTable table)
     throws DbException
Method Detail

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

hasNextRow

public boolean hasNextRow()
                   throws DbException
Are there more rows to iterator through?

Returns:
Description of the Returned Value
Throws:
DbException - Description of Exception

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

nextRow

public DbRow nextRow()
              throws DbException
Get the next DbRow in the table.

Returns:
Description of the Returned Value
Throws:
DbException - Description of Exception

getNext

boolean getNext()
          throws DbException,
                 java.sql.SQLException
DbException
java.sql.SQLException