public class RecordIterator<R extends DBObject>
extends java.lang.Object
implements java.io.Closeable
Note that the underlying ResultSet is closed automatically when all records have been read. But you MUST close the ResultSet by yourself if you break the iteration before reaching the end.
Note that if no order clause is given, then default ordering by primary key is assumed. If you don't want ordering, then you should pass a null value as order clause.
Constructor and Description |
---|
RecordIterator(DBObject master) |
RecordIterator(DBObject master,
SqlCondition condition) |
RecordIterator(DBObject master,
SqlCondition condition,
SqlOrder order) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying ResultSet.
|
int |
getRecordCount()
Returns the number of records that have been read during the iteration.
|
boolean |
hasNext()
Checks the underlying ResultSet whether there are more records to read.
|
R |
next()
Reads the next record from the underlying ResultSet.
|
public RecordIterator(DBObject master) throws java.sql.SQLException
java.sql.SQLException
public RecordIterator(DBObject master, SqlCondition condition) throws java.sql.SQLException
java.sql.SQLException
public RecordIterator(DBObject master, SqlCondition condition, SqlOrder order) throws java.sql.SQLException
java.sql.SQLException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean hasNext() throws java.sql.SQLException
java.sql.SQLException
close()
public R next() throws java.sql.SQLException
java.sql.SQLException
hasNext()
public int getRecordCount()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.