|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.darkmist.alib.db.ResultSetIterator<E>
public class ResultSetIterator<E>
Iterator interface to a ResultSet.
| Nested Class Summary | |
|---|---|
static interface |
ResultSetIterator.Row2Obj<E>
ResultSet to Object conversion interface. |
| Constructor Summary | |
|---|---|
protected |
ResultSetIterator(Connection db,
String sql)
|
protected |
ResultSetIterator(PreparedStatement stmt)
|
protected |
ResultSetIterator(PreparedStatement stmt,
boolean exclusive)
|
|
ResultSetIterator(PreparedStatement stmt,
ResultSetIterator.Row2Obj<E> converter)
Create a ResultSetIterator from a
PreparedStatement. |
|
ResultSetIterator(PreparedStatement stmt,
ResultSetIterator.Row2Obj<E> converter,
boolean exclusive)
|
protected |
ResultSetIterator(ResultSet rs)
|
protected |
ResultSetIterator(ResultSet rs,
boolean exclusive)
|
|
ResultSetIterator(ResultSet rs,
ResultSetIterator.Row2Obj<E> converter)
Create a ResultSetIterator from a
ResultSet. |
| Method Summary | |
|---|---|
void |
close()
|
boolean |
hasNext()
More data to retrieve? |
E |
next()
Return the next result. |
void |
remove()
Unsupported remove operation. |
protected void |
setConverter(ResultSetIterator.Row2Obj<E> converter)
|
ResultSetIterator<E> |
setExclusive()
|
ResultSetIterator<E> |
setExclusive(boolean exclusive)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResultSetIterator(ResultSet rs,
ResultSetIterator.Row2Obj<E> converter)
throws SQLException
ResultSetIterator from a
ResultSet.
rs - The result set to iterate through.converter - The ResultSetIterator.Row2Obj to convert rows to
objects with.
SQLException - if the ResultSet does
when calling ResultSet.next().
public ResultSetIterator(PreparedStatement stmt,
ResultSetIterator.Row2Obj<E> converter)
throws SQLException
ResultSetIterator from a
PreparedStatement.
stmt - The query PreparedStatement to execute and use results from.converter - The ResultSetIterator.Row2Obj to convert rows to
objects with.
SQLException - if calling
PreparedStatement.executeQuery() on stmt does or if
calling ResultSet.next() on the resulting
ResultSet does.
public ResultSetIterator(PreparedStatement stmt,
ResultSetIterator.Row2Obj<E> converter,
boolean exclusive)
throws SQLException
SQLException
protected ResultSetIterator(ResultSet rs,
boolean exclusive)
throws SQLException
SQLException
protected ResultSetIterator(ResultSet rs)
throws SQLException
SQLException
protected ResultSetIterator(PreparedStatement stmt)
throws SQLException
SQLException
protected ResultSetIterator(PreparedStatement stmt,
boolean exclusive)
throws SQLException
SQLException
protected ResultSetIterator(Connection db,
String sql)
throws SQLException
SQLException| Method Detail |
|---|
protected void setConverter(ResultSetIterator.Row2Obj<E> converter)
throws SQLException
SQLException
public void close()
throws SQLException
SQLException
public ResultSetIterator<E> setExclusive(boolean exclusive)
throws SQLException
SQLException
public ResultSetIterator<E> setExclusive()
throws SQLException
SQLExceptionpublic boolean hasNext()
hasNext in interface Iterator<E>
public E next()
throws NoSuchElementException
next in interface Iterator<E>converter's
ResultSetIterator.Row2Obj.resultSetIteratorRow2Obj(ResultSet) method.
NoSuchElementException - if there are no more results.
IllegalStateException - For other exceptions caught from ResultSetIterator.Row2Obj.resultSetIteratorRow2Obj(ResultSet) or an SQLException from ResultSet.next().
public void remove()
throws UnsupportedOperationException
remove in interface Iterator<E>UnsupportedOperationException - always
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||