public class LazySqlQueryResult extends Object implements QueryResult, Iterator<QueryResultRow>
Modifier and Type | Field and Description |
---|---|
private Collection<String> |
_columnNames
The column names.
|
protected ResultSet |
_resultSet
The wrapped ResultSet
|
protected Query.ResultType |
_resultType
The result type.
|
Constructor and Description |
---|
LazySqlQueryResult(ResultSet resultSet)
Constructs a query result around a
ResultSet . |
Modifier and Type | Method and Description |
---|---|
protected Collection<String> |
_extractColumnNames(ResultSet resultSet)
Extract the column names of a JDBC result set.
|
void |
close()
Close and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.
|
Collection<String> |
getColumnNames()
Get the column names.
|
int |
getSize()
Get size
|
Query.ResultType |
getType()
Get the type of the result.
|
boolean |
hasNext() |
Iterator<QueryResultRow> |
iterator() |
QueryResultRow |
next() |
void |
remove() |
void |
setType(Query.ResultType resultType)
Set the result type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
protected Query.ResultType _resultType
protected ResultSet _resultSet
private Collection<String> _columnNames
public LazySqlQueryResult(ResultSet resultSet)
ResultSet
.resultSet
- the result setpublic Query.ResultType getType()
QueryResult
getType
in interface QueryResult
public int getSize()
QueryResult
getSize
in interface QueryResult
public void setType(Query.ResultType resultType)
resultType
- the result type.public Collection<String> getColumnNames() throws DataInclusionException
QueryResult
getColumnNames
in interface QueryResult
DataInclusionException
- if an error occurs while manipulating the data sourcespublic Iterator<QueryResultRow> iterator()
iterator
in interface Iterable<QueryResultRow>
public boolean hasNext()
hasNext
in interface Iterator<QueryResultRow>
public QueryResultRow next()
next
in interface Iterator<QueryResultRow>
public void remove()
remove
in interface Iterator<QueryResultRow>
public void close()
QueryResult
close
in interface QueryResult
protected Collection<String> _extractColumnNames(ResultSet resultSet) throws SQLException
resultSet
- the JDBC result set.SQLException
- if an exception occurs when manipulating the result set