Class ResultSet

java.lang.Object
com.sparsity.sparksee.gdb.ResultSet

public class ResultSet extends Object
ResultSet class.

Author:
Sparsity Technologies http://www.sparsity-technologies.com
  • Method Details

    • rewind

      public void rewind()
      Positions the cursor before the first row.

    • getColumnDataType

      public DataType getColumnDataType(int index)
      Gets the datatype for the given column.

      Parameters:
      index - [in] Column index.
      Returns:
      DataType for the given column.
    • getColumn

      public Value getColumn(int index)
      Gets the value for the given column.

      QueryExceptionIf a database access error occurs.

      Parameters:
      index - [in] Column index.
      Returns:
      The Value of the given column.
    • getNumColumns

      public int getNumColumns()
      Gets the number of columns.

      Columns are in the range [0...COLUMNS).

      Returns:
      The number of columns.
    • getColumnName

      public String getColumnName(int index)
      Gets the name for the given column.

      Parameters:
      index - [in] Column index.
      Returns:
      Column name.
    • next

      public boolean next()
      Fetches the next row.

      A ResultSet cursor is initially positioned before the first row; the first call to the method "Next" makes the first row the current row; the second call makes the second row the current row, and so on.

      QueryExceptionIf a database access error occurs.

      Returns:
      TRUE if the next row has been successfully fetched, FALSE otherwise.
    • getJSON

      public String getJSON(int rows)
      Returns rows in JSON format.

      Rows are returned from the current position.

      JSON representation of the next <rows> rows in the resultset

      Parameters:
      rows - [in] Maximum number of rows
      Returns:
      JSON representation of the next <rows> rows in the resultset
    • getColumn

      public void getColumn(int index, Value value)
      Gets the value for the given column.

      QueryExceptionIf a database access error occurs.

      Parameters:
      index - [in] Column index.
      value - [in|out] Value.
    • getColumnIndex

      public int getColumnIndex(String name)
      Gets the column index for the given column name.

      Parameters:
      name - [in] Column name.
      Returns:
      Column index.