Interface QueryResult
-
public interface QueryResult
Interface used to retrieve results of a query executed using theQueryManagerService
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getColumnCount()
Returns the amount of columns in the result.int
getRowCount()
Returns the amount of rows in the result.ArrayList<HashMap<String,Object>>
getRows()
Returns all rows in the result as arraylist of mappings of column names onto valuesObject
getValue()
Returns the value of the result assuming there is exactly one row and one column in the result.Object
getValue(int row)
Returns the value of the result on the specified row assuming there is exactly one column in the result.Object
getValue(int row, String column)
Returns the value of the result on the specified row and column name.boolean
hasResults()
Returns if the query returned results (at least one row with one column)
-
-
-
Method Detail
-
getRowCount
int getRowCount()
Returns the amount of rows in the result.- Returns:
- amount of rows in the result
-
getColumnCount
int getColumnCount()
Returns the amount of columns in the result.- Returns:
- amount of columns in the result
-
getValue
Object getValue() throws SQLException
Returns the value of the result assuming there is exactly one row and one column in the result.- Returns:
- value of the result
- Throws:
SQLException
- if there is not exactly one row and one column in the result.
-
getValue
Object getValue(int row) throws SQLException
Returns the value of the result on the specified row assuming there is exactly one column in the result. Throws an SQLException if there is not exactly one column in the result or the specified row exceeds the number of rows contained by the result.- Parameters:
row
- Row to retrieve the result for- Returns:
- value of the result at the specified row
- Throws:
SQLException
- if there is not exactly one column in the result or the specified row exceeds the number of rows contained by the result.
-
getValue
Object getValue(int row, String column) throws SQLException
Returns the value of the result on the specified row and column name.- Parameters:
row
- Row to retrieve the result forcolumn
- Name of the column to retrieve the result for- Returns:
- value of the result at the specified row and column
- Throws:
SQLException
- in case there is no column in the result with the specified name or if the specified row exceeds the number of rows contained by the result.
-
getRows
ArrayList<HashMap<String,Object>> getRows()
Returns all rows in the result as arraylist of mappings of column names onto values- Returns:
- all rows in the result
-
hasResults
boolean hasResults()
Returns if the query returned results (at least one row with one column)- Returns:
true
if the query returned results,false
otherwise
-
-