public class SqlQueryResult extends Object implements QueryResult
Modifier and Type | Field and Description |
---|---|
private Collection<String> |
_columnNames
The column names.
|
protected Query.ResultType |
_resultType
The result type.
|
protected List<QueryResultRow> |
_rows
The result rows.
|
Constructor and Description |
---|
SqlQueryResult(ResultSet resultSet)
Constructs a query result around a ResultSet.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_extractResults(ResultSet resultSet)
Extract the column names and results from 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.
|
Iterator<QueryResultRow> |
iterator() |
void |
setType(Query.ResultType resultType)
Set the result type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected Query.ResultType _resultType
protected List<QueryResultRow> _rows
private Collection<String> _columnNames
public SqlQueryResult(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 void close()
QueryResult
close
in interface QueryResult
protected void _extractResults(ResultSet resultSet) throws SQLException
resultSet
- the JDBC result set.SQLException
- if an error occurs when manipulating the result set