Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class TemporaryRowHolderResultSet

extends Object
implements CursorResultSet, NoPutResultSet, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.store.access.RowLocationRetRowSource, org.apache.derby.iapi.store.access.RowSource, org.apache.derby.iapi.sql.ResultSet, org.apache.derby.iapi.sql.execute.CursorResultSet
Imports
java.sql.SQLWarning, .Timestamp, org.w3c.dom.Element, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, .ResultDescription, .ResultSet, .Row, org.apache.derby.iapi.sql.dictionary.TriggerDescriptor, .DataDictionary, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecRow, .NoPutResultSet, .RowChanger, .TargetResultSet, org.apache.derby.iapi.store.access.ConglomerateController, .ScanController, .TransactionController, org.apache.derby.iapi.types.DataValueDescriptor, .RowLocation, .SQLLongint

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

Field Summary

Modifier and TypeField and Description
private RowLocation
private ExecRow
private boolean
private boolean
pack-priv ConglomerateController
private TemporaryRowHolderImpl
pack-priv DataValueDescriptor[]
pack-priv ScanController
private boolean
private boolean
private boolean
private int
private long
private ResultDescription
private ExecRow[]
private ScanController
private TransactionController

Constructor Summary

AccessConstructor and Description
public
TemporaryRowHolderResultSet(TransactionController
the xact controller
tc
,
ExecRow[]
the row array
rowArray
,
ResultDescription
value returned by getResultDescription()
resultDescription
,
boolean isVirtualMemHeap, TemporaryRowHolderImpl holder)

Constructor

public
TemporaryRowHolderResultSet(TransactionController
the xact controller
tc
,
ExecRow[]
the row array
rowArray
,
ResultDescription
value returned by getResultDescription()
resultDescription
,
boolean isVirtualMemHeap, boolean
true,if we can insert rows after this result is created
isAppendable
,
long
conglomId of the index which has order rows are inserted and their row location
positionIndexConglomId
,
TemporaryRowHolderImpl holder)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
addWarning(SQLWarning
the warning to add
w
)

Implements org.apache.derby.iapi.sql.ResultSet.addWarning.

Add a warning to this result set.

public boolean

Returns:

true if before the first row, false otherwise. Returns false when the result set contains no rows.
checkRowPosition
(int
The desired position type
isType
)

Implements org.apache.derby.iapi.sql.ResultSet.checkRowPosition.

Determine if the cursor is before the first row in the result set.

public void
cleanUp()

Implements org.apache.derby.iapi.sql.ResultSet.cleanUp.

Tells the system to clean up on an error.

public void
public Object
clone()

Overrides java.lang.Object.clone.

Shallow clone this result set.

public void
public void
closeRowSource()

Implements org.apache.derby.iapi.store.access.RowSource.closeRowSource.

closeRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have.

public void
public void
finish()

Implements org.apache.derby.iapi.sql.ResultSet.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().

public ExecRow

Returns:

The row at the absolute position, or NULL if no such position.
getAbsoluteRow
(int
The position.
row
)

Implements org.apache.derby.iapi.sql.ResultSet.getAbsoluteRow.

Returns the row at the absolute position from the query, and returns NULL when there is no such position.

public final Activation

Returns:

activation
getActivation
()

Implements org.apache.derby.iapi.sql.ResultSet.getActivation.

Return the Activation for this result set.

public ResultSet
getAutoGeneratedKeysResultset()

Implements org.apache.derby.iapi.sql.ResultSet.getAutoGeneratedKeysResultset.

ResultSet for rows inserted into the table (contains auto-generated keys columns only)

public Timestamp

Returns:

Timestamp The Timestamp for the beginning of execution.
getBeginExecutionTimestamp
()

Implements org.apache.derby.iapi.sql.ResultSet.getBeginExecutionTimestamp.

Get the Timestamp for the beginning of execution.

public ExecRow

Returns:

the last row returned;
getCurrentRow
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

This result set has its row from the last fetch done.

public String

Returns:

A String with the name of the cursor, if any. Returns NULL if this is not a cursor statement.
getCursorName
()

Implements org.apache.derby.iapi.sql.ResultSet.getCursorName.

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

public Timestamp

Returns:

Timestamp The Timestamp for the end of execution.
getEndExecutionTimestamp
()

Implements org.apache.derby.iapi.sql.ResultSet.getEndExecutionTimestamp.

Get the Timestamp for the end of execution.

public double

Returns:

The estimated row count (as a double) from this result set.
getEstimatedRowCount
()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getEstimatedRowCount.

Get the estimated row count from this result set.

public long

Returns:

long The execution time in milliseconds.
getExecuteTime
()

Implements org.apache.derby.iapi.sql.ResultSet.getExecuteTime.

Get the execution time in milliseconds.

public ExecRow

Returns:

The first row, or NULL if no rows.
getFirstRow
()

Implements org.apache.derby.iapi.sql.ResultSet.getFirstRow.

Returns the first row from the query, and returns NULL when there are no rows.

public ExecRow

Returns:

The last row, or NULL if no rows.
getLastRow
()

Implements org.apache.derby.iapi.sql.ResultSet.getLastRow.

Returns the last row from the query, and returns NULL when there are no rows.

public static TemporaryRowHolderResultSet

Returns:

a single row result set
getNewRSOnCurrentRow
(TriggerDescriptor
We are building Temp resultset for this trigger
triggerd
,
Activation
the activation
activation
,
CursorResultSet
the result set
rs
,
int[]
The passed resultset is composed of these columns. We will create a temp resultset which will have either all these columns or only a subset of these columns. It all depends on what columns are needed by the trigger. If this param is null, then that means that all the columns from the trigger table have been read into the passed resultset.
colsReadFromTable
)

Whip up a new Temp ResultSet that has a single row.

private ExecRow
public ExecRow

Returns:

The next row, or NULL if no more rows.
getNextRow
()

Implements org.apache.derby.iapi.sql.ResultSet.getNextRow.

Returns the next row from the query, and returns NULL when there are no more rows.

public ExecRow

Returns:

the next row, or null if none
getNextRowCore
()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Get the next row.

public DataValueDescriptor[]
getNextRowFromRowSource()

Implements org.apache.derby.iapi.store.access.RowSource.getNextRowFromRowSource.

Get the next row as an array of column objects.

public int

Returns:

int Point of attachment (result set number) for this subquery. (-1 if not a subquery - also Sanity violation)
getPointOfAttachment
()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getPointOfAttachment.

Return the point of attachment for this subquery.

public ExecRow

Returns:

The previous row, or NULL if no more previous rows.
getPreviousRow
()

Implements org.apache.derby.iapi.sql.ResultSet.getPreviousRow.

Returns the previous row from the query, and returns NULL when there are no more previous rows.

public ExecRow

Returns:

The row at the relative position, or NULL if no such position.
getRelativeRow
(int
The position.
row
)

Implements org.apache.derby.iapi.sql.ResultSet.getRelativeRow.

Returns the row at the relative position from the current cursor position, and returns NULL when there is no such position.

public ResultDescription

Returns:

A ResultDescription describing the results of the statement.
getResultDescription
()

Implements org.apache.derby.iapi.sql.ResultSet.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.

public RowLocation

Returns:

the row location of the current cursor row.
getRowLocation
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

Returns the row location of the current base table row of the cursor.

public int

Returns:

the row number, or 0 if not on a row
getRowNumber
()

Implements org.apache.derby.iapi.sql.ResultSet.getRowNumber.

Returns the row number of the current row.

public int

Returns:

The isolation level of the scan (in TransactionController constants).
getScanIsolationLevel
()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getScanIsolationLevel.

Return the isolation level of the scan in the result set.

public NoPutResultSet[]

Returns:

NoPutResultSet[] Array of NoPutResultSets for subqueries.
getSubqueryTrackingArray
(int
The size of the array (For allocation on demand.)
numSubqueries
)

Implements org.apache.derby.iapi.sql.ResultSet.getSubqueryTrackingArray.

Get the subquery ResultSet tracking array from the top ResultSet.

public long

Returns:

long The total amount of time spent (in milliseconds).
getTimeSpent
(int
CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
type
)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

public FormatableBitSet
getValidColumns()

Implements org.apache.derby.iapi.store.access.RowSource.getValidColumns.

getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call.

public SQLWarning
getWarnings()

Implements org.apache.derby.iapi.sql.ResultSet.getWarnings.

Return the set of warnings generated during the execution of this result set.

public boolean

Returns:

true if the ResultSet has been closed.
isClosed
()

Implements org.apache.derby.iapi.sql.ResultSet.isClosed.

Find out if the ResultSet is closed or not.

public boolean

Returns:

Whether or not the result set is for update.
isForUpdate
()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.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

private static int[]
justTheRequiredColumnsPositions(int[] columnsArrary)

public void
markAsTopResultSet()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.markAsTopResultSet.

Mark the ResultSet as the topmost one in the ResultSet tree.

public void
markRowAsDeleted()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Marks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.

public long
modifiedRowCount()

Implements org.apache.derby.iapi.sql.ResultSet.modifiedRowCount.

Returns the number of rows affected by the statement.

public boolean

Returns:

true iff this row source expects some row location to be returned
needsRowLocation
()

Implements org.apache.derby.iapi.store.access.RowLocationRetRowSource.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.

public boolean
public boolean
needsToClone()

Implements org.apache.derby.iapi.store.access.RowSource.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.

public void
public void
open()

Implements org.apache.derby.iapi.sql.ResultSet.open.

Tells the system that there will be calls to getNextRow().

public void
openCore()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.openCore.

Open the scan and evaluate qualifiers and the like.

public void
positionScanAtRowLocation(RowLocation
row location of the current cursor row
rl
)

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.positionScanAtRowLocation.

Positions the cursor in the specified rowLocation.

public void
public boolean
requiresRelocking()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.requiresRelocking.

Do we need to relock the row when going to the heap.

public void
reset(ExecRow[]
the row array
rowArray
)

Reset the exec row array and reinitialize

public void
reStartScan(long currentConglomId, long pconglomId)

postion scan to start from after where we stopped earlier

public int
resultSetNumber()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.resultSetNumber.

Get the number of this ResultSet, which is guaranteed to be unique within a statement.

public boolean

Returns:

TRUE if the statement returns rows, FALSE if not.
returnsRows
()

Implements org.apache.derby.iapi.sql.ResultSet.returnsRows.

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

public void
rowLocation(RowLocation rl)

Implements org.apache.derby.iapi.store.access.RowLocationRetRowSource.rowLocation.

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.

public ExecRow

Returns:

NULL.
setAfterLastRow
()

Implements org.apache.derby.iapi.sql.ResultSet.setAfterLastRow.

Sets the current position to after the last row and returns NULL because there is no current row.

public ExecRow

Returns:

NULL.
setBeforeFirstRow
()

Implements org.apache.derby.iapi.sql.ResultSet.setBeforeFirstRow.

Sets the current position to before the first row and returns NULL because there is no current row.

public void
setCurrentRow(ExecRow
the new current row
row
)

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.setCurrentRow.

Set the current row to the row passed in.

public void
setHasDeferrableChecks()

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.setHasDeferrableChecks.

Set that we are acting on behalf of an insert result set that has deferrable check constraints

public void
setNeedsRowLocation(boolean needsRowLocation)

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.setNeedsRowLocation.

Set whether or not the NPRS need the row location when acting as a row source.

public void
setTargetResultSet(TargetResultSet
The TargetResultSet.
trs
)

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.setTargetResultSet.

Notify a NPRS that it is the source for the specified TargetResultSet.

private void
setupPositionBasedScan(long position)

private static int[]
shrinkArray(int[] columnsArrary)

private static int[]
supersetofAllColumns(int[] columnsArray1, int[] columnsArray2)

public Element
toXML(Element
Node to put content into.
parentNode
,
String
Element tag for content
tag
)

Implements org.apache.derby.iapi.sql.ResultSet.toXML.

Produce an xml image of this ResultSet and its descendant ResultSets.

public void
updateRow(ExecRow
new values for the currentRow
row
,
RowChanger
holds information about row: what columns of it is to be used for updating, and what underlying base table column each such column corresponds to.
rowChanger
)

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

Updates the resultSet's current row with it's new values after an update has been issued either using positioned update or JDBC's udpateRow method.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait