Constructor and Description |
---|
ResultSet()
Default constructor
|
ResultSet(JsonObject json)
Create a result-set from JSON
|
ResultSet(List<String> columnNames,
List<JsonArray> results,
ResultSet next)
Create a result-set
|
ResultSet(ResultSet other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
List<String> |
getColumnNames()
Get the column names
|
ResultSet |
getNext()
Get the next result set
|
int |
getNumColumns()
Return the number of columns in the result set
|
int |
getNumRows()
Return the number of rows in the result set
|
JsonArray |
getOutput()
Get the registered outputs
|
List<JsonArray> |
getResults()
Get the results
|
List<JsonObject> |
getRows()
Get the rows - each row represented as a JsonObject where the keys are the column names and the values are
the column values.
|
List<JsonObject> |
getRows(boolean caseInsensitive)
Get the rows - each row represented as a JsonObject where the keys are the column names and the values are
the column values.
|
int |
hashCode() |
ResultSet |
setColumnNames(List<String> columnNames) |
ResultSet |
setNext(ResultSet next) |
ResultSet |
setOutput(JsonArray output) |
ResultSet |
setResults(List<JsonArray> results) |
JsonObject |
toJson()
Convert to JSON
|
public ResultSet()
public ResultSet(ResultSet other)
other
- result-set to copypublic ResultSet(List<String> columnNames, List<JsonArray> results, ResultSet next)
columnNames
- the column namesresults
- the resultspublic ResultSet(JsonObject json)
json
- the jsonpublic JsonObject toJson()
public JsonArray getOutput()
public ResultSet getNext()
public List<JsonObject> getRows()
getResults()
instead.
Be aware that column names are defined as returned by the database, this means that even if your SQL statement
is for example: SELECT a, b FROM tablethe column names are not required to be:
aand
band could be in fact
Aand
B. For cases when there is the need for case insentivitity you should see
getRows(boolean)
public List<JsonObject> getRows(boolean caseInsensitive)
getResults()
instead.
Special note, when encoding the row JSON to a String or Buffer the column names will be as they returned by the
database server regardless of the case sensitivity chosen on this method call.caseInsensitive
- - treat column names as case insensitive, i.e.: FoO equals foo equals FOOpublic int getNumRows()
public int getNumColumns()
Copyright © 2024 Eclipse. All rights reserved.