public class JDBCResultIterator<T> extends Object implements ResultIterator<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected boolean |
nextRow |
protected ResultSet |
resultSet |
protected Statement |
statement |
Constructor and Description |
---|
JDBCResultIterator(Statement statement,
ResultSet resultSet,
RowReader<T> rowReader)
Creates new JDBCResultIterator that reads from provided ResultSet.
|
Modifier and Type | Method and Description |
---|---|
List<T> |
allRows()
Returns all yet unread rows from ResultSet without closing it.
|
protected void |
checkNextRow()
Moves internal ResultSet cursor position down one row.
|
void |
close()
Closes ResultIterator and associated ResultSet.
|
boolean |
hasNextRow()
Returns true if there is at least one more record that can be read from
the iterator.
|
boolean |
isClosingConnection()
Deprecated.
since 4.0 always returns false. Connection closing is outside
the scope of this iterator. See
ConnectionAwareResultIterator for a replacement. |
Iterator<T> |
iterator() |
T |
nextRow()
Returns the next result row that is, depending on the query, may be a
scalar value, a DataRow, or an Object[] array containing a mix of scalars
and DataRows.
|
void |
setClosingConnection(boolean flag)
Deprecated.
since 4.0 does nothing. Connection closing is outside the
scope of this iterator. See
ConnectionAwareResultIterator for a replacement. |
void |
skipRow()
Goes past current row.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected Statement statement
protected ResultSet resultSet
protected boolean closed
protected boolean nextRow
public List<T> allRows()
ResultIterator
allRows
in interface ResultIterator<T>
public boolean hasNextRow()
hasNextRow
in interface ResultIterator<T>
public T nextRow()
ResultIterator
nextRow
in interface ResultIterator<T>
public void skipRow()
ResultIterator
skipRow
in interface ResultIterator<T>
public void close() throws NoSuchElementException
close
in interface AutoCloseable
close
in interface ResultIterator<T>
NoSuchElementException
protected void checkNextRow()
@Deprecated public boolean isClosingConnection()
ConnectionAwareResultIterator
for a replacement.@Deprecated public void setClosingConnection(boolean flag)
ConnectionAwareResultIterator
for a replacement.closingConnection
property.Copyright © 2001–2017 Apache Cayenne. All rights reserved.