org.apache.derby.impl.sql.execute
Class TemporaryRowHolderResultSet

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet
All Implemented Interfaces:
java.lang.Cloneable, CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource

public class TemporaryRowHolderResultSet
extends java.lang.Object
implements CursorResultSet, NoPutResultSet, java.lang.Cloneable

A result set to scan temporary row holders. Ultimately, this may be returned to users, hence the extra junk from the ResultSet interface.

Author:
jamie

Field Summary
private  RowLocation baseRowLocation
           
private  ExecRow currentRow
           
private  boolean currRowFromMem
           
private  ExecutionFactory ef
           
private  boolean finished
           
(package private)  ConglomerateController heapCC
           
private  TemporaryRowHolderImpl holder
           
(package private)  DataValueDescriptor[] indexRow
           
(package private)  ScanController indexsc
           
private  boolean isAppendable
           
private  boolean isOpen
           
private  boolean isVirtualMemHeap
           
private  int numRowsOut
           
private  long positionIndexConglomId
           
private  ResultDescription resultDescription
           
private  ExecRow[] rowArray
           
private  ScanController scan
           
private  TransactionController tc
           
 
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE
 
Constructor Summary
TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, boolean isAppendable, long positionIndexConglomId, TemporaryRowHolderImpl holder)
          Constructor
TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, TemporaryRowHolderImpl holder)
          Constructor
 
Method Summary
 boolean checkRowPosition(int isType)
          Determine if the cursor is before the first row in the result set.
 void cleanUp()
          Tells the system to clean up on an error.
 void clearCurrentRow()
          Clear the current row
 java.lang.Object clone()
          Shallow clone this result set.
 void close()
          Clean up
 void closeRowSource()
          closeRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have.
 void deleteCurrentRow()
           
 void finish()
          Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open().
 ExecRow getAbsoluteRow(int row)
          Returns the row at the absolute position from the query, and returns NULL when there is no such position.
 ResultSet getAutoGeneratedKeysResultset()
          ResultSet for rows inserted into the table (contains auto-generated keys columns only)
 java.sql.Timestamp getBeginExecutionTimestamp()
          Get the Timestamp for the beginning of execution.
 ExecRow getCurrentRow()
          This result set has its row from the last fetch done.
 java.lang.String getCursorName()
          Returns the name of the cursor, if this is cursor statement of some type (declare, open, fetch, positioned update, positioned delete, close).
 java.sql.Timestamp getEndExecutionTimestamp()
          Get the Timestamp for the end of execution.
 double getEstimatedRowCount()
          Get the estimated row count from this result set.
 long getExecuteTime()
          Get the execution time in milliseconds.
 ExecRow getFirstRow()
          Returns the first row from the query, and returns NULL when there are no rows.
 ExecRow getLastRow()
          Returns the last row from the query, and returns NULL when there are no rows.
static TemporaryRowHolderResultSet getNewRSOnCurrentRow(TransactionController tc, CursorResultSet rs)
          Whip up a new Temp ResultSet that has a single row, the current row of this result set.
private  ExecRow getNextAppendedRow()
           
 ExecRow getNextRow()
          Returns the next row from the query, and returns NULL when there are no more rows.
 ExecRow getNextRowCore()
          Get the next row.
 DataValueDescriptor[] getNextRowFromRowSource()
          Get the next row as an array of column objects.
 int getPointOfAttachment()
          Return the point of attachment for this subquery.
 ExecRow getPreviousRow()
          Returns the previous row from the query, and returns NULL when there are no more previous rows.
 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.
 ResultDescription getResultDescription()
          Returns a ResultDescription object, which describes the results of the statement this ResultSet is in.
 RowLocation getRowLocation()
          Returns the row location of the current base table row of the cursor.
 int getRowNumber()
          Returns the row number of the current row.
 int getScanIsolationLevel()
          Return the isolation level of the scan in the result set.
 NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
          Get the subquery ResultSet tracking array from the top ResultSet.
 long getTimeSpent(int type)
          Return the total amount of time spent in this ResultSet
 FormatableBitSet getValidColumns()
          getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call.
 java.sql.SQLWarning getWarnings()
          Return the set of warnings generated during the execution of this result set.
 boolean isClosed()
          Find out if the ResultSet is closed or not.
 boolean isForUpdate()
          Is this ResultSet or it's source result set for update This method will be overriden in the inherited Classes if it is true
 void markAsTopResultSet()
          Mark the ResultSet as the topmost one in the ResultSet tree.
 int modifiedRowCount()
          Returns the number of rows affected by the statement.
 boolean needsRowLocation()
          needsRowLocation returns true iff this the row source expects the drainer of the row source to call rowLocation after getting a row from getNextRowFromRowSource.
 boolean needsToClone()
          Does the caller of getNextRowFromRowSource() need to clone the row in order to keep a reference to the row past the getNextRowFromRowSource() call which returned the row.
 void open()
          Tells the system that there will be calls to getNextRow().
 void openCore()
          Open the scan and evaluate qualifiers and the like.
 void reopenCore()
          Reopen the scan.
 boolean requiresRelocking()
          Do we need to relock the row when going to the heap.
 void reset(ExecRow[] rowArray)
          Reset the exec row array and reinitialize
 void reStartScan(long currentConglomId, long pconglomId)
          postion scan to start from after where we stopped earlier
 int resultSetNumber()
          Get the number of this ResultSet, which is guaranteed to be unique within a statement.
 boolean returnsRows()
          Returns TRUE if the statement returns rows (i.e. is a SELECT or FETCH statement), FALSE if it returns no rows.
 void rowLocation(RowLocation rl)
          rowLocation is a callback for the drainer of the row source to return the rowLocation of the current row, i.e, the row that is being returned by getNextRowFromRowSource.
 ExecRow setAfterLastRow()
          Sets the current position to after the last row and returns NULL because there is no current row.
 ExecRow setBeforeFirstRow()
          Sets the current position to before the first row and returns NULL because there is no current row.
 void setCurrentRow(ExecRow row)
          Set the current row to the row passed in.
 void setNeedsRowLocation(boolean needsRowLocation)
          Set whether or not the NPRS need the row location when acting as a row source.
 void setTargetResultSet(TargetResultSet trs)
          Notify a NPRS that it is the source for the specified TargetResultSet.
private  void setupPositionBasedScan(long position)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowArray

private ExecRow[] rowArray

numRowsOut

private int numRowsOut

scan

private ScanController scan

tc

private TransactionController tc

isOpen

private boolean isOpen

finished

private boolean finished

currentRow

private ExecRow currentRow

resultDescription

private ResultDescription resultDescription

ef

private ExecutionFactory ef

isAppendable

private boolean isAppendable

positionIndexConglomId

private long positionIndexConglomId

isVirtualMemHeap

private boolean isVirtualMemHeap

currRowFromMem

private boolean currRowFromMem

holder

private TemporaryRowHolderImpl holder

heapCC

ConglomerateController heapCC

baseRowLocation

private RowLocation baseRowLocation

indexRow

DataValueDescriptor[] indexRow

indexsc

ScanController indexsc
Constructor Detail

TemporaryRowHolderResultSet

public TemporaryRowHolderResultSet(TransactionController tc,
                                   ExecRow[] rowArray,
                                   ResultDescription resultDescription,
                                   boolean isVirtualMemHeap,
                                   TemporaryRowHolderImpl holder)
Constructor

Parameters:
tc - the xact controller
rowArray - the row array
resultDescription - value returned by getResultDescription()

TemporaryRowHolderResultSet

public TemporaryRowHolderResultSet(TransactionController tc,
                                   ExecRow[] rowArray,
                                   ResultDescription resultDescription,
                                   boolean isVirtualMemHeap,
                                   boolean isAppendable,
                                   long positionIndexConglomId,
                                   TemporaryRowHolderImpl holder)
Constructor

Parameters:
tc - the xact controller
rowArray - the row array
resultDescription - value returned by getResultDescription()
isAppendable - true,if we can insert rows after this result is created
positionIndexConglomId - conglomId of the index which has order rows are inserted and their row location
Method Detail

reset

public void reset(ExecRow[] rowArray)
Reset the exec row array and reinitialize

Parameters:
rowArray - the row array

reStartScan

public void reStartScan(long currentConglomId,
                        long pconglomId)
                 throws StandardException
postion scan to start from after where we stopped earlier

Throws:
StandardException

getNewRSOnCurrentRow

public static TemporaryRowHolderResultSet getNewRSOnCurrentRow(TransactionController tc,
                                                               CursorResultSet rs)
                                                        throws StandardException
Whip up a new Temp ResultSet that has a single row, the current row of this result set.

Parameters:
tc - the xact controller
rs - the result set
Returns:
a single row result set
Throws:
StandardException - on error

markAsTopResultSet

public void markAsTopResultSet()
Mark the ResultSet as the topmost one in the ResultSet tree. Useful for closing down the ResultSet on an error.

Specified by:
markAsTopResultSet in interface NoPutResultSet
Returns:
Nothing.

openCore

public void openCore()
              throws StandardException
Open the scan and evaluate qualifiers and the like. For us, there are no qualifiers, this is really a noop.

Specified by:
openCore in interface NoPutResultSet
Throws:
StandardException - thrown if cursor finished.

reopenCore

public void reopenCore()
                throws StandardException
Reopen the scan. Typically faster than open()/close()

Specified by:
reopenCore in interface NoPutResultSet
Throws:
StandardException - on error

getNextRowCore

public ExecRow getNextRowCore()
                       throws StandardException
Get the next row.

Specified by:
getNextRowCore in interface NoPutResultSet
Returns:
the next row, or null if none
Throws:
StandardException - on error

deleteCurrentRow

public void deleteCurrentRow()
                      throws StandardException
Throws:
StandardException

setupPositionBasedScan

private void setupPositionBasedScan(long position)
                             throws StandardException
Throws:
StandardException

getNextAppendedRow

private ExecRow getNextAppendedRow()
                            throws StandardException
Throws:
StandardException

getPointOfAttachment

public int getPointOfAttachment()
Return the point of attachment for this subquery. (Only meaningful for Any and Once ResultSets, which can and will only be at the top of a ResultSet for a subquery.)

Specified by:
getPointOfAttachment in interface NoPutResultSet
Returns:
int Point of attachment (result set number) for this subquery. (-1 if not a subquery - also Sanity violation)

getScanIsolationLevel

public int getScanIsolationLevel()
Return the isolation level of the scan in the result set. Only expected to be called for those ResultSets that contain a scan.

Specified by:
getScanIsolationLevel in interface NoPutResultSet
Returns:
The isolation level of the scan (in TransactionController constants).

setTargetResultSet

public void setTargetResultSet(TargetResultSet trs)
Notify a NPRS that it is the source for the specified TargetResultSet. This is useful when doing bulk insert.

Specified by:
setTargetResultSet in interface NoPutResultSet
Parameters:
trs - The TargetResultSet.
Returns:
Nothing.

setNeedsRowLocation

public void setNeedsRowLocation(boolean needsRowLocation)
Set whether or not the NPRS need the row location when acting as a row source. (The target result set determines this.)

Specified by:
setNeedsRowLocation in interface NoPutResultSet
Returns:
Nothing.

getEstimatedRowCount

public double getEstimatedRowCount()
Get the estimated row count from this result set.

Specified by:
getEstimatedRowCount in interface NoPutResultSet
Returns:
The estimated row count (as a double) from this result set.

resultSetNumber

public int resultSetNumber()
Get the number of this ResultSet, which is guaranteed to be unique within a statement.

Specified by:
resultSetNumber in interface NoPutResultSet

setCurrentRow

public void setCurrentRow(ExecRow row)
Set the current row to the row passed in.

Specified by:
setCurrentRow in interface NoPutResultSet
Parameters:
row - the new current row

clearCurrentRow

public void clearCurrentRow()
Clear the current row

Specified by:
clearCurrentRow in interface NoPutResultSet

getCurrentRow

public ExecRow getCurrentRow()
                      throws StandardException
This result set has its row from the last fetch done. If the cursor is closed, a null is returned.

Specified by:
getCurrentRow in interface CursorResultSet
Returns:
the last row returned;
Throws:
StandardException - thrown on failure.
See Also:
CursorResultSet

getRowLocation

public RowLocation getRowLocation()
Returns the row location of the current base table row of the cursor. If this cursor's row is composed of multiple base tables' rows, i.e. due to a join, then a null is returned. For a temporary row holder, we always return null.

Specified by:
getRowLocation in interface CursorResultSet
Returns:
the row location of the current cursor row.

close

public void close()
           throws StandardException
Clean up

Specified by:
close in interface ResultSet
Returns:
Nothing
Throws:
StandardException - thrown on error

returnsRows

public boolean returnsRows()
Returns TRUE if the statement returns rows (i.e. is a SELECT or FETCH statement), FALSE if it returns no rows.

Specified by:
returnsRows in interface ResultSet
Returns:
TRUE if the statement returns rows, FALSE if not.

modifiedRowCount

public int modifiedRowCount()
Description copied from interface: ResultSet
Returns the number of rows affected by the statement. Only valid of returnsRows() returns false. For other DML statements, it returns the number of rows modified by the statement. For statements that do not affect rows (like DDL statements), it returns zero.

Specified by:
modifiedRowCount in interface ResultSet
Returns:
The number of rows affect by the statement, so far.

getResultDescription

public ResultDescription getResultDescription()
Returns a ResultDescription object, which describes the results of the statement this ResultSet is in. This will *not* be a description of this particular ResultSet, if this is not the outermost ResultSet.

Specified by:
getResultDescription in interface ResultSet
Returns:
A ResultDescription describing the results of the statement.

open

public void open()
          throws StandardException
Tells the system that there will be calls to getNextRow().

Specified by:
open in interface ResultSet
Returns:
Nothing
Throws:
StandardException - Thrown on failure

getAbsoluteRow

public ExecRow getAbsoluteRow(int row)
                       throws StandardException
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.

Specified by:
getAbsoluteRow in interface ResultSet
Parameters:
row - The position.
Returns:
The row at the absolute position, or NULL if no such position.
Throws:
StandardException - Thrown on failure
See Also:
Row

getRelativeRow

public ExecRow getRelativeRow(int row)
                       throws StandardException
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.

Specified by:
getRelativeRow in interface ResultSet
Parameters:
row - The position.
Returns:
The row at the relative position, or NULL if no such position.
Throws:
StandardException - Thrown on failure
See Also:
Row

setBeforeFirstRow

public ExecRow setBeforeFirstRow()
                          throws StandardException
Sets the current position to before the first row and returns NULL because there is no current row.

Specified by:
setBeforeFirstRow in interface ResultSet
Returns:
NULL.
Throws:
StandardException - Thrown on failure
See Also:
Row

getFirstRow

public ExecRow getFirstRow()
                    throws StandardException
Returns the first row from the query, and returns NULL when there are no rows.

Specified by:
getFirstRow in interface ResultSet
Returns:
The first row, or NULL if no rows.
Throws:
StandardException - Thrown on failure
See Also:
Row

getNextRow

public ExecRow getNextRow()
                   throws StandardException
Returns the next row from the query, and returns NULL when there are no more rows.

Specified by:
getNextRow in interface ResultSet
Returns:
The next row, or NULL if no more rows.
Throws:
StandardException - Thrown on failure
See Also:
Row

getPreviousRow

public ExecRow getPreviousRow()
                       throws StandardException
Returns the previous row from the query, and returns NULL when there are no more previous rows.

Specified by:
getPreviousRow in interface ResultSet
Returns:
The previous row, or NULL if no more previous rows.
Throws:
StandardException - Thrown on failure
See Also:
Row

getLastRow

public ExecRow getLastRow()
                   throws StandardException
Returns the last row from the query, and returns NULL when there are no rows.

Specified by:
getLastRow in interface ResultSet
Returns:
The last row, or NULL if no rows.
Throws:
StandardException - Thrown on failure
See Also:
Row

setAfterLastRow

public ExecRow setAfterLastRow()
                        throws StandardException
Sets the current position to after the last row and returns NULL because there is no current row.

Specified by:
setAfterLastRow in interface ResultSet
Returns:
NULL.
Throws:
StandardException - Thrown on failure
See Also:
Row

checkRowPosition

public boolean checkRowPosition(int isType)
Determine if the cursor is before the first row in the result set.

Specified by:
checkRowPosition in interface ResultSet
Returns:
true if before the first row, false otherwise. Returns false when the result set contains no rows.

getRowNumber

public int getRowNumber()
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).

Specified by:
getRowNumber in interface ResultSet
Returns:
the row number, or 0 if not on a row

cleanUp

public void cleanUp()
             throws StandardException
Tells the system to clean up on an error.

Specified by:
cleanUp in interface ResultSet
Returns:
Nothing
Throws:
StandardException - Thrown on error.

isClosed

public boolean isClosed()
Find out if the ResultSet is closed or not. Will report true for result sets that do not return rows.

Specified by:
isClosed in interface ResultSet
Returns:
true if the ResultSet has been closed.

finish

public void finish()
            throws StandardException
Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open(). Will close the result set if it is not already closed.

Specified by:
finish in interface ResultSet
Returns:
Nothing
Throws:
StandardException - on error

getExecuteTime

public long getExecuteTime()
Get the execution time in milliseconds.

Specified by:
getExecuteTime in interface ResultSet
Returns:
long The execution time in milliseconds.

getAutoGeneratedKeysResultset

public ResultSet getAutoGeneratedKeysResultset()
Description copied from interface: ResultSet
ResultSet for rows inserted into the table (contains auto-generated keys columns only)

Specified by:
getAutoGeneratedKeysResultset in interface ResultSet
Returns:
NoPutResultSet NoPutResultSets for rows inserted into the table.
See Also:
ResultSet.getAutoGeneratedKeysResultset()

getBeginExecutionTimestamp

public java.sql.Timestamp getBeginExecutionTimestamp()
Get the Timestamp for the beginning of execution.

Specified by:
getBeginExecutionTimestamp in interface ResultSet
Returns:
Timestamp The Timestamp for the beginning of execution.

getEndExecutionTimestamp

public java.sql.Timestamp getEndExecutionTimestamp()
Get the Timestamp for the end of execution.

Specified by:
getEndExecutionTimestamp in interface ResultSet
Returns:
Timestamp The Timestamp for the end of execution.

getTimeSpent

public long getTimeSpent(int type)
Return the total amount of time spent in this ResultSet

Specified by:
getTimeSpent in interface ResultSet
Parameters:
type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
Returns:
long The total amount of time spent (in milliseconds).

getSubqueryTrackingArray

public NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
Get the subquery ResultSet tracking array from the top ResultSet. (Used for tracking open subqueries when closing down on an error.)

Specified by:
getSubqueryTrackingArray in interface ResultSet
Parameters:
numSubqueries - The size of the array (For allocation on demand.)
Returns:
NoPutResultSet[] Array of NoPutResultSets for subqueries.

getCursorName

public java.lang.String getCursorName()
Returns the name of the cursor, if this is cursor statement of some type (declare, open, fetch, positioned update, positioned delete, close).

Specified by:
getCursorName in interface ResultSet
Returns:
A String with the name of the cursor, if any. Returns NULL if this is not a cursor statement.

requiresRelocking

public boolean requiresRelocking()
Description copied from interface: NoPutResultSet
Do we need to relock the row when going to the heap.

Specified by:
requiresRelocking in interface NoPutResultSet
Returns:
Whether or not we need to relock the row when going to the heap.
See Also:
NoPutResultSet.requiresRelocking()

getNextRowFromRowSource

public DataValueDescriptor[] getNextRowFromRowSource()
                                              throws StandardException
Get the next row as an array of column objects. The column objects can be a JBMS Storable or any Serializable/Externalizable/Formattable/Streaming type.
A return of null indicates that the complete set of rows has been read.

A null column can be specified by leaving the object null, or indicated by returning a non-null getValidColumns. On streaming columns, it can be indicated by returning a non-null get FieldStates.

If RowSource.needToClone() is true then the returned row (the DataValueDescriptor[]) is guaranteed not to be modified by drainer of the RowSource (except that the input stream will be read, of course) and drainer will keep no reference to it before making the subsequent nextRow call. So it is safe to return the same DataValueDescriptor[] in subsequent nextRow calls if that is desirable for performance reasons.

If RowSource.needToClone() is false then the returned row (the DataValueDescriptor[]) may be be modified by drainer of the RowSource, and the drainer may keep a reference to it after making the subsequent nextRow call. In this case the client should severe all references to the row after returning it from getNextRowFromRowSource().

Specified by:
getNextRowFromRowSource in interface RowSource
Throws:
StandardException - Cloudscape Standard Error Policy

needsToClone

public boolean needsToClone()
Does the caller of getNextRowFromRowSource() need to clone the row in order to keep a reference to the row past the getNextRowFromRowSource() call which returned the row. This call must always return the same for all rows in a RowSource (ie. the caller will call this once per scan from a RowSource and assume the behavior is true for all rows in the RowSource).

Specified by:
needsToClone in interface RowSource

getValidColumns

public FormatableBitSet getValidColumns()
getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call. If getValidColumns returns null, the number of columns is given by the DataValueDescriptor.length where DataValueDescriptor[] is returned by the preceeding getNextRowFromRowSource() call. Column N maps to DataValueDescriptor[N], where column numbers start at zero. If getValidColumns return a non null validColumns FormatableBitSet the number of columns is given by the number of bits set in validColumns. Column N is not in the partial row if validColumns.get(N) returns false. Column N is in the partial row if validColumns.get(N) returns true. If column N is in the partial row then it maps to DataValueDescriptor[M] where M is the count of calls to validColumns.get(i) that return true where i < N. If DataValueDescriptor.length is greater than the number of columns indicated by validColumns the extra entries are ignored.

Specified by:
getValidColumns in interface RowSource

closeRowSource

public void closeRowSource()
closeRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have. Subsequent call to any method on the RowSource will result in undefined behavior. A closed rowSource can be closed again.

Specified by:
closeRowSource in interface RowSource

needsRowLocation

public boolean needsRowLocation()
needsRowLocation returns true iff this the row source expects the drainer of the row source to call rowLocation after getting a row from getNextRowFromRowSource.

Specified by:
needsRowLocation in interface RowLocationRetRowSource
Returns:
true iff this row source expects some row location to be returned
See Also:
rowLocation(org.apache.derby.iapi.types.RowLocation)

rowLocation

public void rowLocation(RowLocation rl)
                 throws StandardException
rowLocation is a callback for the drainer of the row source to return the rowLocation of the current row, i.e, the row that is being returned by getNextRowFromRowSource. This interface is for the purpose of loading a base table with index. In that case, the indices can be built at the same time the base table is laid down once the row location of the base row is known. This is an example pseudo code on how this call is expected to be used:
                boolean needsRL = rowSource.needsRowLocation();
                DataValueDescriptor[] row;
                while((row = rowSource.getNextRowFromRowSource()) != null)
                {
                        RowLocation rl = heapConglomerate.insertRow(row);
                        if (needsRL)
                                rowSource.rowLocation(rl);
                }
                

NeedsRowLocation and rowLocation will ONLY be called by a drainer of the row source which CAN return a row location. Drainer of row source which cannot return rowLocation will guarentee to not call either callbacks. Conversely, if NeedsRowLocation is called and it returns true, then for every row return by getNextRowFromRowSource, a rowLocation callback must also be issued with the row location of the row. Implementor of both the source and the drain of the row source must be aware of this protocol.
The RowLocation object is own by the caller of rowLocation, in other words, the drainer of the RowSource. This is so that we don't need to new a row location for every row. If the Row Source wants to keep the row location, it needs to clone it (RowLocation is a ClonableObject).

Specified by:
rowLocation in interface RowLocationRetRowSource
Throws:
StandardException - on error

isForUpdate

public boolean isForUpdate()
Is this ResultSet or it's source result set for update This method will be overriden in the inherited Classes if it is true

Specified by:
isForUpdate in interface NoPutResultSet
Returns:
Whether or not the result set is for update.

clone

public java.lang.Object clone()
Shallow clone this result set. Used in trigger reference. beetle 4373.


getWarnings

public java.sql.SQLWarning getWarnings()
Description copied from interface: ResultSet
Return the set of warnings generated during the execution of this result set. The warnings are cleared once this call returns.

Specified by:
getWarnings in interface ResultSet

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.