com.sparsity.sparksee.gdb
Class ResultSet

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

public class ResultSet
extends java.lang.Object

ResultSet class.

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

Method Summary
 void close()
          Closes the iterator.
 Value getColumn(int index)
          Gets the value for the given column.
 void getColumn(int index, Value value)
          Gets the value for the given column.
 DataType getColumnDataType(int index)
          Gets the datatype for the given column.
 int getColumnIndex(java.lang.String name)
          Gets the column index for the given column name.
 java.lang.String getColumnName(int index)
          Gets the name for the given column.
 java.lang.String getJSON(int rows)
          Returns rows in JSON format.
 int getNumColumns()
          Gets the number of columns.
 boolean next()
          Fetches the next row.
 void rewind()
          Positions the cursor before the first row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

rewind

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


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.

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.

getColumnIndex

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

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

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 java.lang.String getJSON(int rows)
Returns rows in JSON format.

Rows are returned from the current position.

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

close

public void close()
Closes the iterator.


getColumnName

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

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

getColumnDataType

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

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

getNumColumns

public int getNumColumns()
Gets the number of columns.

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

Returns:
The number of columns.