com.iisc.jwc.jsheet.db
Class JSDbCursor

java.lang.Object
  extended bycom.iisc.jwc.jsheet.db.JSDbCursor

public class JSDbCursor
extends java.lang.Object

Cursors are the mechanism through which data that is queried by a SELECT statement is retrieved.


Field Summary
static int COLUMN_HEADERS
          The data for the column heaers is retrieved.
static int FETCH_ABSOLUTE
          An integer is included with this command to specify the row in the active set of rows from which data is retrieved.
static int FETCH_ALL
          All the data in the active set of rows is retrieved.
static int FETCH_CURRENT
          The data in the current row is retrieved.
static int FETCH_FIRST
          The data from the first row in the active set of rows is retrieved.
static int FETCH_LAST
          The data from the last row in the active set of rows is retrieved.
static int FETCH_NEXT
          The data from the next row in the active set of rows is retrieved.
static int FETCH_PREVIOUS
          The data from the previous row in the active set of rows is retrieved.
static int FETCH_RELATIVE
          An integer is included with this command to specify how many rows from the current cursor position the cursor is to move before retrieving data.
static int FETCH_ROWS
          Data is retrieved from multiple rows in the active set of rows.
 
Constructor Summary
JSDbCursor(com.iisc.jwc.orb.CCursor c)
          For internal use only!
 
Method Summary
 void closeCursor()
          This method closes the specified SQL database cursor.
 JSValueMatrix describeColumns()
          Describes the columns in the result set.
 JSDbRowSet fetch(int which)
          Retrieves data based upon the type of fetch specified.
 JSDbRowSet fetchAt(int which, int num)
          Retrieves data based upon the specified type of fetch and position.
 Range fetchInto(java.lang.String startCell, int mode)
          Retrieves data based upon the type of fetch specified and places the results at the starting cell.
 int getNumCols()
          Returns the number of columns in the result set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_HEADERS

public static final int COLUMN_HEADERS
The data for the column heaers is retrieved.

See Also:
Constant Field Values

FETCH_ABSOLUTE

public static final int FETCH_ABSOLUTE
An integer is included with this command to specify the row in the active set of rows from which data is retrieved. This requires a scrolling cursor.

See Also:
Constant Field Values

FETCH_ALL

public static final int FETCH_ALL
All the data in the active set of rows is retrieved.

See Also:
Constant Field Values

FETCH_CURRENT

public static final int FETCH_CURRENT
The data in the current row is retrieved. This requires a scrolling cursor.

See Also:
Constant Field Values

FETCH_FIRST

public static final int FETCH_FIRST
The data from the first row in the active set of rows is retrieved. This requires a scrolling cursor.

See Also:
Constant Field Values

FETCH_LAST

public static final int FETCH_LAST
The data from the last row in the active set of rows is retrieved. This requires a scrolling cursor.

See Also:
Constant Field Values

FETCH_NEXT

public static final int FETCH_NEXT
The data from the next row in the active set of rows is retrieved.

See Also:
Constant Field Values

FETCH_PREVIOUS

public static final int FETCH_PREVIOUS
The data from the previous row in the active set of rows is retrieved. This requires a scrolling cursor.

See Also:
Constant Field Values

FETCH_RELATIVE

public static final int FETCH_RELATIVE
An integer is included with this command to specify how many rows from the current cursor position the cursor is to move before retrieving data. This requires a scrolling cursor.

See Also:
Constant Field Values

FETCH_ROWS

public static final int FETCH_ROWS
Data is retrieved from multiple rows in the active set of rows. An integer is included with this command to specify the number of rows, including the current row, from which data is retrieved.

See Also:
Constant Field Values
Constructor Detail

JSDbCursor

public JSDbCursor(com.iisc.jwc.orb.CCursor c)
For internal use only!

Parameters:
c - for internal use only!
Method Detail

closeCursor

public void closeCursor()
                 throws JSDbException
This method closes the specified SQL database cursor.

Throws:
JSDbException - An exception occured while fetching the data.

describeColumns

public JSValueMatrix describeColumns()
                              throws JSDbException
Describes the columns in the result set. It produces a result value matrix that contains a list of the columns from the specified table and information about each column. The result set returned by this command contains at least 12 columns with the following information. The result set is ordered by Qualifier, Owner, and Table.
Result Set ColumnContent
1Table qualifier
2Table owner
3Table name
4Column name
5Column type
6Data source-dependent data type name
7Column precision
8Column length
9Column scaling factor
10Column radix
11Column null status
12Remarks

Returns:
Information on the columns in the result set.
Throws:
JSDbException - An exception occured while communicating with the database.

fetch

public JSDbRowSet fetch(int which)
                 throws JSDbException
Retrieves data based upon the type of fetch specified.

Parameters:
which - The type of fetch to perform (see class static variables).
Returns:
A rowset of data that was retrieved from the database.
Throws:
JSDbException - An exception occured while fetching the data.

fetchAt

public JSDbRowSet fetchAt(int which,
                          int num)
                   throws JSDbException
Retrieves data based upon the specified type of fetch and position.

Parameters:
which - The type of fetch to perform (see class static variables).
num - The start position for the fetch.
Returns:
A rowset of data that was retrieved from the database.
Throws:
JSDbException - An exception occured while fetching the data.

fetchInto

public Range fetchInto(java.lang.String startCell,
                       int mode)
                throws JSDbException,
                       JSException
Retrieves data based upon the type of fetch specified and places the results at the starting cell.

Parameters:
startCell - The location in the spreadsheet to place the result set. This must be a fully qualified name formatted as: BookName.jss:SheetName!A2. A range may also be used instead of a single cell. If a range is used and the range is smaller than the result set, the result set will be truncated.
mode - The type of fetch to perform (see class static variables).
Returns:
A range that indicates the area the result set was placed.
Throws:
JSDbException - An exception occured while fetching the data.
JSException - An exception occured communicating with JSServer.

getNumCols

public int getNumCols()
               throws JSDbException
Returns the number of columns in the result set.

Returns:
The number of columns in the result set.
Throws:
JSDbException - An exception occured while fetching the data.

Email JSheet Support

www.jsheet.com
Copyright 1995 - 2003 Investment Intelligence Systems Limited.