| java.lang.Object org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl org.apache.derby.impl.sql.execute.NoPutResultSetImpl org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet
ScrollInsensitiveResultSet | public class ScrollInsensitiveResultSet extends NoPutResultSetImpl implements CursorResultSet(Code) | | Provide insensitive scrolling functionality for the underlying
result set. We build a disk backed hash table of rows as the
user scrolls forward, with the position as the key.
For read-only result sets the hash table will containg the
following columns:
+-------------------------------+
| KEY |
+-------------------------------+
| Row |
+-------------------------------+
where key is the position of the row in the result set and row is the data.
And for updatable result sets it will contain:
+-------------------------------+
| KEY | [0]
+-------------------------------+
| RowLocation | [POS_ROWLOCATION]
+-------------------------------+
| Deleted | [POS_ROWDELETED]
+-------------------------------+
| Updated | [POS_ROWUPDATED]
+-------------------------------+
| Row | [extraColumns ... n]
+-------------------------------+
where key is the position of the row in the result set, rowLocation is
the row location of that row in the Heap, Deleted indicates whether the
row has been deleted, Updated indicates whether the row has been updated,
and row is the data.
|
Method Summary | |
public boolean | checkRowPosition(int isType) Determine if the cursor is before the first row in the result
set. | public void | close() If the result set has been opened,
close the open scan. | public void | finish() | public ExecRow | getAbsoluteRow(int row) Returns the row at the absolute position from the query,
and returns NULL when there is no such position. | public ExecRow | getCurrentRow() Gets information from last getNextRow call. | public ExecRow | getFirstRow() Returns the first row from the query, and returns NULL when there
are no rows. | public ExecRow | getLastRow() Returns the last row from the query, and returns NULL when there
are no rows. | public ExecRow | getNextRowCore() | public ExecRow | getPreviousRow() Returns the previous row from the query, and returns NULL when there
are no more previous rows. | public ExecRow | getRelativeRow(int row) Returns the row at the relative position from the current
cursor position, and returns NULL when there is no such position. | public RowLocation | getRowLocation() Gets information from its source. | public int | getRowNumber() Returns the row number of the current row. | public long | getTimeSpent(int type) Return the total amount of time spent in this ResultSet
Parameters: type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSetENTIRE_RESULTSET_TREE - time spent in this ResultSet and below. | public boolean | isDeleted() | public boolean | isForUpdate() | public boolean | isUpdated() | public void | markRowAsDeleted() | public void | openCore() open a scan on the source. | public void | reopenCore() reopen a scan on the table. | public ExecRow | setAfterLastRow() Sets the current position to after the last row and returns NULL
because there is no current row. | public ExecRow | setBeforeFirstRow() Sets the current position to before the first row and returns NULL
because there is no current row. | public void | updateRow(ExecRow row) |
numFromHashTable | public int numFromHashTable(Code) | | |
numToHashTable | public int numToHashTable(Code) | | |
ScrollInsensitiveResultSet | public ScrollInsensitiveResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, int sourceRowWidth, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException(Code) | | Constructor for a ScrollInsensitiveResultSet
Parameters: source - The NoPutResultSet from which to get rowsto scroll through Parameters: activation - The activation for this execution Parameters: resultSetNumber - The resultSetNumber Parameters: sourceRowWidth - # of columns in the source row exception: StandardException - on error |
checkRowPosition | public boolean checkRowPosition(int isType) throws StandardException(Code) | | Determine if the cursor is before the first row in the result
set.
true if before the first row, false otherwise. Returnsfalse when the result set contains no rows. exception: StandardException - Thrown on error. |
getAbsoluteRow | public ExecRow getAbsoluteRow(int row) throws StandardException(Code) | | Returns the row at the absolute position from the query,
and returns NULL when there is no such position.
(Negative position means from the end of the result set.)
Moving the cursor to an invalid position leaves the cursor
positioned either before the first row (negative position)
or after the last row (positive position).
NOTE: An exception will be thrown on 0.
Parameters: row - The position. The row at the absolute position, or NULL if no such position. exception: StandardException - Thrown on failure See Also: Row |
getPreviousRow | public ExecRow getPreviousRow() throws StandardException(Code) | | Returns the previous row from the query, and returns NULL when there
are no more previous rows.
The previous row, or NULL if no more previous rows. exception: StandardException - Thrown on failure See Also: Row |
getRelativeRow | public ExecRow getRelativeRow(int row) throws StandardException(Code) | | Returns the row at the relative position from the current
cursor position, and returns NULL when there is no such position.
(Negative position means toward the beginning of the result set.)
Moving the cursor to an invalid position leaves the cursor
positioned either before the first row (negative position)
or after the last row (positive position).
NOTE: 0 is valid.
NOTE: An exception is thrown if the cursor is not currently
positioned on a row.
Parameters: row - The position. The row at the relative position, or NULL if no such position. exception: StandardException - Thrown on failure See Also: Row |
getRowLocation | public RowLocation getRowLocation() throws StandardException(Code) | | Gets information from its source. We might want
to have this take a CursorResultSet in its constructor some day,
instead of doing a cast here?
See Also: CursorResultSet the row location of the current cursor row. exception: StandardException - thrown on failure |
getRowNumber | public int getRowNumber()(Code) | | Returns the row number of the current row. Row
numbers start from 1 and go to 'n'. Corresponds
to row numbering used to position current row
in the result set (as per JDBC).
the row number, or 0 if not on a row |
getTimeSpent | public long getTimeSpent(int type)(Code) | | Return the total amount of time spent in this ResultSet
Parameters: type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSetENTIRE_RESULTSET_TREE - time spent in this ResultSet and below. long The total amount of time spent (in milliseconds). |
isDeleted | public boolean isDeleted() throws StandardException(Code) | | Returns TRUE if the row was been deleted within the transaction,
otherwise returns FALSE
True if the row has been deleted, otherwise false exception: StandardException - on error |
isForUpdate | public boolean isForUpdate()(Code) | | |
isUpdated | public boolean isUpdated() throws StandardException(Code) | | Returns TRUE if the row was been updated within the transaction,
otherwise returns FALSE
True if the row has been deleted, otherwise false exception: StandardException - on error |
openCore | public void openCore() throws StandardException(Code) | | open a scan on the source. scan parameters are evaluated
at each open, so there is probably some way of altering
their values...
exception: StandardException - thrown on failure |
reopenCore | public void reopenCore() throws StandardException(Code) | | reopen a scan on the table. scan parameters are evaluated
at each open, so there is probably some way of altering
their values...
exception: StandardException - thrown if cursor finished. |
setBeforeFirstRow | public ExecRow setBeforeFirstRow()(Code) | | Sets the current position to before the first row and returns NULL
because there is no current row.
NULL. See Also: Row |
|
|