io.vertx.ext.sql

## Class ResultSet

- java.lang.Object
- - io.vertx.ext.sql.ResultSet

-     public class ResultSet
      extends Object

  Represents the results of a SQL query.

  It contains a list for the column names of the results, and a list of `JsonArray` - one for each row of the results.

  Author:
    Tim Fox

- - ### Constructor Summary

    Constructors
    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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.
    `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

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResultSet

          public ResultSet()

      Default constructor

    - #### ResultSet

          public ResultSet(ResultSet other)

      Copy constructor
      Parameters:
        `other` - result-set to copy

    - #### ResultSet

          public ResultSet(List<String> columnNames,
                           List<JsonArray> results,
                           ResultSet next)

      Create a result-set
      Parameters:
        `columnNames` - the column names
        `results` - the results

    - #### ResultSet

          public ResultSet(JsonObject json)

      Create a result-set from JSON
      Parameters:
        `json` - the json

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Convert to JSON
      Returns:
        json object

    - #### getResults

          public List<JsonArray> getResults()

      Get the results
      Returns:
        the results

    - #### setResults

          public ResultSet setResults(List<JsonArray> results)

    - #### getOutput

          public JsonArray getOutput()

      Get the registered outputs
      Returns:
        the outputs

    - #### setOutput

          public ResultSet setOutput(JsonArray output)

    - #### getColumnNames

          public List<String> getColumnNames()

      Get the column names
      Returns:
        the column names

    - #### setColumnNames

          public ResultSet setColumnNames(List<String> columnNames)

    - #### getNext

          public ResultSet getNext()

      Get the next result set
      Returns:
        the next resultset

    - #### setNext

          public ResultSet setNext(ResultSet next)

    - #### getRows

          public 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.

      Beware that it's legal for a query result in SQL to contain duplicate column names, in which case one will overwrite the other if using this method. If that's the case use `getResults()` instead.

      Returns:
        the rows represented as JSON object instances

    - #### getNumRows

          public int getNumRows()

      Return the number of rows in the result set
      Returns:
        the number of rows

    - #### getNumColumns

          public int getNumColumns()

      Return the number of columns in the result set
      Returns:
        the number of columns

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2017. All rights reserved.