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

pack-priv abstract Class BasicNoPutResultSetImpl

extends Object
implements NoPutResultSet
Class Inheritance
All Implemented Interfaces
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
Known Direct Subclasses
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
Imports
java.lang.reflect.Array, .Field, java.sql.SQLWarning, .Timestamp, java.util.Arrays, .ArrayList, .Comparator, org.w3c.dom.Element, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.i18n.MessageService, 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.conn.LanguageConnectionContext, .StatementContext, org.apache.derby.iapi.sql.execute.ExecRow, .ExecutionFactory, .NoPutResultSet, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.iapi.util.InterruptStatus

Abstract ResultSet for for operations that return rows but do not allow the caller to put data on output pipes. This basic implementation does not include support for an Activiation. See NoPutResultSetImpl.java for an implementaion with support for an activiation.

This abstract class does not define the entire ResultSet interface, but leaves the 'get' half of the interface for subtypes to implement. It is package-visible only, with its methods being public for exposure by its subtypes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
protected final Activation
private int[]
public long
public long
pack-priv ExecRow
public long
protected ExecRow
protected long
protected boolean
protected boolean
protected boolean
public long
public int
public long
public double
public double
pack-priv ResultDescription
public int
public int
protected long
private StatementContext
private final boolean
public NoPutResultSet[]
private transient TransactionController
private SQLWarning

Constructor Summary

AccessConstructor and Description
pack-priv
BasicNoPutResultSetImpl(ResultDescription
the result description. May be null.
resultDescription
,
Activation
The activation
activation
,
double
The optimizer's estimate of the total number of rows for this result set
optimizerEstimatedRowCount
,
double
The optimizer's estimated cost for this result set
optimizerEstimatedCost
)

Constructor.

Method Summary

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

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

Add a warning to this result set.

protected void
attachStatementContext()

Attach this result set to the top statement context on the stack.

public void
checkCancellationFlag()

Checks whether the currently executing statement has been cancelled.

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 static Element
childrenToXML(Element outerNode, ResultSet outerRS)

Pretty-print the inner ResultSet fields inside an outer ResultSet.

public void
protected final String

Returns:

Nothing.
dumpTimeStats
(String indent, String subIndent)

Dump out the time information for run time stats.

private static void
findResultSetFields(ArrayList<Field> fieldList, final Class<?> klass)

Find all fields of type ResultSet.

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().

protected final void
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
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.

protected ExecRow

Returns:

A compact row.
getCompactRow
(ExecRow
The row to get the columns from
candidate
,
FormatableBitSet
A bit map of the columns that are accessed in the candidate row
accessedCols
,
boolean
Tells whether to return a ValueRow or an IndexRow
isKeyed
)

Get a compacted version of the candidate row according to the columns specified in the bit map.

protected final long

Returns:

long Current time in milliseconds.
getCurrentTimeMillis
()

Return the current time in milliseconds, if DEBUG and RunTimeStats is on, else return 0.

protected final long

Returns:

long Elapsed time in milliseconds.
getElapsedMillis
(long beginTime)

Return the elapsed time in milliseconds, between now and the beginTime, if DEBUG and RunTimeStats is on, else return 0.

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
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.

pack-priv final ExecutionFactory

Returns:

the execution factory
getExecutionFactory
()

Get a execution factory

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.

protected final LanguageConnectionContext

Returns:

the language connection context
getLanguageConnectionContext
()

Cache the language connection context.

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 final ExecRow

Returns:

the next row in the result
getNextRow
()

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

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

public abstract ExecRow
getNextRowCore()

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

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

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

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

Returns the description of the table's rows

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
getScanIsolationLevel()

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

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

public final NoPutResultSet[]
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.

pack-priv final TransactionController
getTransactionController()

Get the current transaction controller.

public final 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
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

protected final boolean
public void
markAsTopResultSet()

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

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

public final long
modifiedRowCount()

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

Returns the number of rows affected by the statement.

public final void
open()

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

open a scan on the table.

protected final void
recordConstructorTime()

Allow sub-classes to record the total time spent in their constructor time.

public void
reopenCore()

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

This is the default implementation of reopenCore().

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 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
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.

protected ExecRow

Returns:

The compact row to use
setCompactRow
(ExecRow
The candidate row from the store
candidateRow
,
ExecRow
The compact row to fill in
compactRow
)

Copy columns from the candidate row from the store to the given compact row.

protected final void
setCompatRow(ExecRow compactRow, DataValueDescriptor[] sourceRow)

private static String
stripPackage(String className)

Strip the package location from a class name

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 static Element
toXML(Element parentNode, String childTag, ResultSet rs)

Pretty-print a ResultSet as an xml child of a parent node.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activationback to summary
protected final Activation activation
baseColumnMapback to summary
private int[] baseColumnMap
beginTimeback to summary
public long beginTime
closeTimeback to summary
public long closeTime
compactRowback to summary
pack-priv ExecRow compactRow
constructorTimeback to summary
public long constructorTime
currentRowback to summary
protected ExecRow currentRow
endExecutionTimeback to summary
protected long endExecutionTime
finishedback to summary
protected boolean finished
isOpenback to summary
protected boolean isOpen
isTopResultSetback to summary
protected boolean isTopResultSet
nextTimeback to summary
public long nextTime
numOpensback to summary
public int numOpens
openTimeback to summary
public long openTime
optimizerEstimatedCostback to summary
public double optimizerEstimatedCost
optimizerEstimatedRowCountback to summary
public double optimizerEstimatedRowCount
resultDescriptionback to summary
pack-priv ResultDescription resultDescription
rowsFilteredback to summary
public int rowsFiltered
rowsSeenback to summary
public int rowsSeen
startExecutionTimeback to summary
protected long startExecutionTime
statementContextback to summary
private StatementContext statementContext
statisticsTimingOnback to summary
private final boolean statisticsTimingOn
subqueryTrackingArrayback to summary
public NoPutResultSet[] subqueryTrackingArray
tcback to summary
private transient TransactionController tc
warningsback to summary
private SQLWarning warnings

Constructor Detail

BasicNoPutResultSetImplback to summary
pack-priv BasicNoPutResultSetImpl(ResultDescription resultDescription, Activation activation, double optimizerEstimatedRowCount, double optimizerEstimatedCost)

Constructor.
Sets beginTime for all children to use to measue constructor time.

Parameters
resultDescription:ResultDescription

the result description. May be null.

activation:Activation

The activation

optimizerEstimatedRowCount:double

The optimizer's estimate of the total number of rows for this result set

optimizerEstimatedCost:double

The optimizer's estimated cost for this result set

Method Detail

addWarningback to summary
public final void addWarning(SQLWarning w)

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

Doc from org.apache.derby.iapi.sql.ResultSet.addWarning.

Add a warning to this result set.

Parameters
w:SQLWarning

the warning to add

attachStatementContextback to summary
protected void attachStatementContext() throws StandardException

Attach this result set to the top statement context on the stack. Result sets can be directly read from the JDBC layer. The JDBC layer will push and pop a statement context around each ResultSet.getNext(). There's no guarantee that the statement context used for the last getNext() will be the context used for the current getNext(). The last statement context may have been popped off the stack and so will not be available for cleanup if an error occurs. To make sure that we will be cleaned up, we always attach ourselves to the top context. The fun and games occur in nested contexts: using JDBC result sets inside user code that is itself invoked from queries or CALL statements.

Exceptions
StandardException:
thrown if cursor finished.
checkCancellationFlagback to summary
public void checkCancellationFlag() throws StandardException

Checks whether the currently executing statement has been cancelled. This is done by checking the statement's allocated StatementContext object.

See Also
StatementContext
checkRowPositionback to summary
public boolean checkRowPosition(int isType) throws StandardException

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

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

Parameters
isType:int

Doc from org.apache.derby.iapi.sql.ResultSet.checkRowPosition.

The desired position type

Returns:boolean

true if before the first row, false otherwise. Returns false when the result set contains no rows.

Exceptions
StandardException:

Doc from org.apache.derby.iapi.sql.ResultSet.checkRowPosition.

Thrown on error.

childrenToXMLback to summary
public static Element childrenToXML(Element outerNode, ResultSet outerRS) throws Exception

Pretty-print the inner ResultSet fields inside an outer ResultSet. Returns the outerNode.

cleanUpback to summary
public void cleanUp() throws StandardException

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

Clean up on error

Exceptions
StandardException:
Thrown on failure
dumpTimeStatsback to summary
protected final String dumpTimeStats(String indent, String subIndent)

Dump out the time information for run time stats.

Returns:String

Nothing.

findResultSetFieldsback to summary
private static void findResultSetFields(ArrayList<Field> fieldList, final Class<?> klass) throws Exception

Find all fields of type ResultSet.

finishback to summary
public void finish() throws StandardException

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

Doc from 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(). Will close the result set if it is not already closed.

Exceptions
StandardException:
on error
finishAndRTSback to summary
protected final void finishAndRTS() throws StandardException
Exceptions
StandardException:
on error
getAbsoluteRowback to summary
public ExecRow getAbsoluteRow(int row) throws StandardException

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. (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:int

The position.

Returns:ExecRow

The row at the absolute position, or NULL if no such position.

Exceptions
StandardException:
Thrown on failure
See Also
Row
getActivationback to summary
public final Activation getActivation()

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

getAutoGeneratedKeysResultsetback to summary
public ResultSet getAutoGeneratedKeysResultset()

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

Doc from org.apache.derby.iapi.sql.ResultSet.getAutoGeneratedKeysResultset.

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

Returns:ResultSet

NoPutResultSet NoPutResultSets for rows inserted into the table.

See Also
ResultSet#getAutoGeneratedKeysResultset
getBeginExecutionTimestampback to summary
public Timestamp getBeginExecutionTimestamp()

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

Get the Timestamp for the beginning of execution.

Returns:Timestamp

Timestamp The Timestamp for the beginning of execution.

getCompactRowback to summary
protected ExecRow getCompactRow(ExecRow candidate, FormatableBitSet accessedCols, boolean isKeyed) throws StandardException

Get a compacted version of the candidate row according to the columns specified in the bit map. Share the holders between rows. If there is no bit map, use the candidate row as the compact row. Also, create an array of ints mapping base column positions to compact column positions, to make it cheaper to copy columns to the compact row, if we ever have to do it again.

Parameters
candidate:ExecRow

The row to get the columns from

accessedCols:FormatableBitSet

A bit map of the columns that are accessed in the candidate row

isKeyed:boolean

Tells whether to return a ValueRow or an IndexRow

Returns:ExecRow

A compact row.

getCurrentTimeMillisback to summary
protected final long getCurrentTimeMillis()

Return the current time in milliseconds, if DEBUG and RunTimeStats is on, else return 0. (Only pay price of system call if need to.)

Returns:long

long Current time in milliseconds.

getElapsedMillisback to summary
protected final long getElapsedMillis(long beginTime)

Return the elapsed time in milliseconds, between now and the beginTime, if DEBUG and RunTimeStats is on, else return 0. (Only pay price of system call if need to.)

Returns:long

long Elapsed time in milliseconds.

getEndExecutionTimestampback to summary
public Timestamp getEndExecutionTimestamp()

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

Get the Timestamp for the end of execution.

Returns:Timestamp

Timestamp The Timestamp for the end of execution.

getEstimatedRowCountback to summary
public double getEstimatedRowCount()

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

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.getEstimatedRowCount.

Get the estimated row count from this result set.

Returns:double

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

See Also
NoPutResultSet#getEstimatedRowCount
getExecuteTimeback to summary
public long getExecuteTime()

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

Get the execution time in milliseconds.

Returns:long

long The execution time in milliseconds.

getExecutionFactoryback to summary
pack-priv final ExecutionFactory getExecutionFactory()

Get a execution factory

Returns:ExecutionFactory

the execution factory

getFirstRowback to summary
public ExecRow getFirstRow() throws StandardException

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

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

Returns:ExecRow

The first row, or NULL if no rows.

Exceptions
StandardException:
Thrown on failure
See Also
Row
getLanguageConnectionContextback to summary
protected final LanguageConnectionContext getLanguageConnectionContext()

Cache the language connection context. Return it.

Returns:LanguageConnectionContext

the language connection context

getLastRowback to summary
public ExecRow getLastRow() throws StandardException

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

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

Returns:ExecRow

The last row, or NULL if no rows.

Exceptions
StandardException:
Thrown on failure
See Also
Row
getNextRowback to summary
public final ExecRow getNextRow() throws StandardException

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

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

restriction and projection parameters are evaluated for each row.

Note

This method should only be called on the top ResultSet of a ResultSet tree to ensure that the entire ResultSet tree gets closed down on an error. the getNextRowCore() method will be called for all other ResultSets in the tree.

Returns:ExecRow

the next row in the result

Exceptions
StandardException:
  • thrown on failure.
  • ResultSetNotOpen thrown if not yet open.
getNextRowCoreback to summary
public abstract ExecRow getNextRowCore() throws StandardException

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

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

restriction and projection parameters are evaluated for each row.

Returns:ExecRow

the next row in the result

Exceptions
StandardException:
thrown if cursor finished.
See Also
NoPutResultSet#getNextRowCore
getPointOfAttachmentback to summary
public int getPointOfAttachment()

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

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

Returns:int

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

See Also
NoPutResultSet#getPointOfAttachment
getPreviousRowback to summary
public ExecRow getPreviousRow() throws StandardException

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.

Returns:ExecRow

The previous row, or NULL if no more previous rows.

Exceptions
StandardException:
Thrown on failure
See Also
Row
getRelativeRowback to summary
public ExecRow getRelativeRow(int row) throws StandardException

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. (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:int

The position.

Returns:ExecRow

The row at the relative position, or NULL if no such position.

Exceptions
StandardException:
Thrown on failure
See Also
Row
getResultDescriptionback to summary
public ResultDescription getResultDescription()

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

Returns the description of the table's rows

Returns:ResultDescription

Doc from org.apache.derby.iapi.sql.ResultSet.getResultDescription.

A ResultDescription describing the results of the statement.

getRowNumberback to summary
public int getRowNumber()

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

Returns:int

the row number, or 0 if not on a row

getScanIsolationLevelback to summary
public int getScanIsolationLevel()

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

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.getScanIsolationLevel.

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

Returns:int

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

See Also
NoPutResultSet#getScanIsolationLevel
getSubqueryTrackingArrayback to summary
public final NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)

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

Doc from org.apache.derby.iapi.sql.ResultSet.getSubqueryTrackingArray.

Get the subquery ResultSet tracking array from the top ResultSet. (Used for tracking open subqueries when closing down on an error.)

Parameters
numSubqueries:int

The size of the array (For allocation on demand.)

Returns:NoPutResultSet[]

NoPutResultSet[] Array of NoPutResultSets for subqueries.

See Also
ResultSet#getSubqueryTrackingArray
getTransactionControllerback to summary
pack-priv final TransactionController getTransactionController()

Get the current transaction controller.

getWarningsback to summary
public final SQLWarning getWarnings()

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

Doc from org.apache.derby.iapi.sql.ResultSet.getWarnings.

Return the set of warnings generated during the execution of this result set. The warnings are cleared once this call returns.

Returns:SQLWarning

the execution warnings

isClosedback to summary
public boolean isClosed()

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

Report if closed.

Returns:boolean

Doc from org.apache.derby.iapi.sql.ResultSet.isClosed.

true if the ResultSet has been closed.

isForUpdateback to summary
public boolean 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

Returns:boolean

Whether or not the result set is for update.

isXplainOnlyModeback to summary
protected final boolean isXplainOnlyMode()
markAsTopResultSetback to summary
public void markAsTopResultSet()

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

Mark the ResultSet as the topmost one in the ResultSet tree. Useful for closing down the ResultSet on an error.

modifiedRowCountback to summary
public final long modifiedRowCount()

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

Doc from org.apache.derby.iapi.sql.ResultSet.modifiedRowCount.

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.

Returns:long

The number of rows affect by the statement, so far.

openback to summary
public final void open() throws StandardException

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

open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Note

This method should only be called on the top ResultSet of a ResultSet tree to ensure that the entire ResultSet tree gets closed down on an error. the openCore() method will be called for all other ResultSets in the tree.

Exceptions
StandardException:
thrown if cursor finished.
recordConstructorTimeback to summary
protected final void recordConstructorTime()

Allow sub-classes to record the total time spent in their constructor time.

reopenCoreback to summary
public void reopenCore() throws StandardException

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

This is the default implementation of reopenCore(). It simply does a close() followed by an open(). If there are optimizations to be made (caching, etc), this is a good place to do it -- this will be overridden by a number of resultSet imlementations. and SHOULD be overridden by any node that can get between a base table and a join.

Exceptions
StandardException:
thrown if cursor finished.
See Also
NoPutResultSet#openCore
requiresRelockingback to summary
public boolean requiresRelocking()

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

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.requiresRelocking.

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

Returns:boolean

Whether or not we need to relock the row when going to the heap.

See Also
NoPutResultSet#requiresRelocking
resultSetNumberback to summary
public int resultSetNumber()

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

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.resultSetNumber.

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

See Also
NoPutResultSet#resultSetNumber()
returnsRowsback to summary
public boolean returnsRows()

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

Returns true.

Returns:boolean

Doc from org.apache.derby.iapi.sql.ResultSet.returnsRows.

TRUE if the statement returns rows, FALSE if not.

setAfterLastRowback to summary
public ExecRow setAfterLastRow() throws StandardException

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.

Returns:ExecRow

NULL.

Exceptions
StandardException:
Thrown on failure
See Also
Row
setBeforeFirstRowback to summary
public ExecRow setBeforeFirstRow() throws StandardException

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.

Returns:ExecRow

NULL.

Exceptions
StandardException:
Thrown on failure
See Also
Row
setCompactRowback to summary
protected ExecRow setCompactRow(ExecRow candidateRow, ExecRow compactRow)

Copy columns from the candidate row from the store to the given compact row. If there is no column map, just use the candidate row. This method assumes the above method (getCompactRow()) was called first. getCompactRow() sets up the baseColumnMap.

Parameters
candidateRow:ExecRow

The candidate row from the store

compactRow:ExecRow

The compact row to fill in

Returns:ExecRow

The compact row to use

setCompatRowback to summary
protected final void setCompatRow(ExecRow compactRow, DataValueDescriptor[] sourceRow)
stripPackageback to summary
private static String stripPackage(String className)

Strip the package location from a class name

toXMLback to summary
public Element toXML(Element parentNode, String tag) throws Exception

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

Doc from org.apache.derby.iapi.sql.ResultSet.toXML.

Produce an xml image of this ResultSet and its descendant ResultSets. Appends an element to the parentNode and returns the appended element.

Parameters
parentNode:Element

Node to put content into.

tag:String

Element tag for content

Returns:Element

the content as an element with the given tag name

Exceptions
Exception:
on error
toXMLback to summary
public static Element toXML(Element parentNode, String childTag, ResultSet rs) throws Exception

Pretty-print a ResultSet as an xml child of a parent node. Return the node representing the ResultSet child.

org.apache.derby.impl.sql.execute back to summary

public final Class BasicNoPutResultSetImpl.FieldComparator

extends Object
implements Comparator<Field>
Class Inheritance
  • java.lang.Object
  • org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.FieldComparator
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
compare(Field
the first object to be compared.
left
,
Field
the second object to be compared.
right
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FieldComparatorback to summary
public FieldComparator()

Method Detail

compareback to summary
public int compare(Field left, Field right)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
left:Field

the first object to be compared.

right:Field

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.