Class SqlQueryResult
java.lang.Object
org.ametys.plugins.externaldata.data.sql.SqlQueryResult
- All Implemented Interfaces:
Iterable<QueryResultRow>,QueryResult
SQL query result.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Query.ResultTypeThe result type.protected List<QueryResultRow>The result rows. -
Constructor Summary
ConstructorsConstructorDescriptionSqlQueryResult(ResultSet resultSet) Constructs a query result around a ResultSet. -
Method Summary
Modifier and TypeMethodDescriptionprotected void_extractResults(ResultSet resultSet) Extract the column names and results from a JDBC result set.voidclose()Close and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.Get the column names.intgetSize()Get sizegetType()Get the type of the result.iterator()voidsetType(Query.ResultType resultType) Set the result type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
_resultType
The result type. -
_rows
The result rows.
-
-
Constructor Details
-
SqlQueryResult
Constructs a query result around a ResultSet.- Parameters:
resultSet- the result set
-
-
Method Details
-
getType
Description copied from interface:QueryResultGet the type of the result.- Specified by:
getTypein interfaceQueryResult- Returns:
- the result type.
-
getSize
Description copied from interface:QueryResultGet size- Specified by:
getSizein interfaceQueryResult- Returns:
- the size
-
setType
Set the result type.- Parameters:
resultType- the result type.
-
getColumnNames
Description copied from interface:QueryResultGet the column names.- Specified by:
getColumnNamesin interfaceQueryResult- Returns:
- the column names as a Collection.
- Throws:
DataInclusionException- if an error occurs while manipulating the data sources
-
iterator
- Specified by:
iteratorin interfaceIterable<QueryResultRow>
-
close
Description copied from interface:QueryResultClose and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.- Specified by:
closein interfaceQueryResult
-
_extractResults
Extract the column names and results from a JDBC result set.- Parameters:
resultSet- the JDBC result set.- Throws:
SQLException- if an error occurs when manipulating the result set
-