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

pack-priv abstract Class NoRowsResultSetImpl

extends Object
implements ResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.ResultSet
Known Direct Subclasses
org.apache.derby.impl.sql.execute.CallStatementResultSet, org.apache.derby.impl.sql.execute.DMLWriteResultSet, org.apache.derby.impl.sql.execute.MergeResultSet, org.apache.derby.impl.sql.execute.MiscResultSet
Imports
java.sql.SQLWarning, .Timestamp, 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.loader.GeneratedMethod, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, .ResultColumnDescriptor, .ResultDescription, .ResultSet, .Row, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, .StatementContext, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, .DataDictionary, .TableDescriptor, org.apache.derby.iapi.sql.execute.ExecRow, .NoPutResultSet, .ResultSetStatisticsFactory, .RunTimeStatistics, org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor, org.apache.derby.iapi.types.BooleanDataValue, .DataValueDescriptor

Abstract ResultSet for implementations that do not return rows. Examples are DDL statements, CALL statements and DML.

An implementation must provide a ResultSet.open() method that performs the required action.

ResultSet.returnsRows() returns false and any method that fetches a row will throw an exception.

Field Summary

Modifier and TypeField and Description
pack-priv final Activation
protected long
protected long
protected long
protected long
private int
private int[]
private boolean
isOpen

True if the result set has been opened, and not yet closed.

pack-priv final LanguageConnectionContext
private DataValueDescriptor[]
private final boolean
private NoPutResultSet[]

Constructor Summary

AccessConstructor and Description
pack-priv

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 final 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 final void
public void
close(boolean
True if this is part of an action of a MERGE statement.
underMerge
)

Dump the stat if not already done so.

public boolean

Returns:

Whether or not this ResultSet cause a commit or rollback.
doesCommit
()

Does this ResultSet cause a commit or rollback.

public void
evaluateGenerationClauses(GeneratedMethod
the generated method which evaluates generation clauses
generationClauses
,
Activation
the thread-specific instance of the generated class
activation
,
NoPutResultSet
the tuple stream driving this INSERT/UPDATE
source
,
ExecRow
the base row being stuffed
newRow
,
boolean
true if this is an UPDATE. false otherwise.
isUpdate
)

Compute the generation clauses on the current row in order to fill in computed columns.

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

Returns:

long Current time in milliseconds.
getCurrentTimeMillis
()

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

public String
getCursorName()

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

Return the cursor name, null in this case.

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 long

Returns:

long The execution time in milliseconds.
getExecuteTime
()

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

Get the execution time in milliseconds.

public final 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 final 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
getNextRow()

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

No rows to return, so throw an exception.

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

Returns:

String The query plan as a String.
getQueryPlanText
(int
Indentation level.
depth
)

RESOLVE - This method will go away once it is overloaded in all subclasses.

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

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 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 closed, false otherwise
isClosed
()

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

Find out if the ResultSet is closed.

public long
public final boolean
public final 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 final 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.

pack-priv void
setup()

Set up the result set for use.

private void
setupGeneratedColumns(Activation activation, ValueRow newRow)

Construct support for normalizing generated columns.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activationback to summary
pack-priv final Activation activation
beginExecutionTimeback to summary
protected long beginExecutionTime
beginTimeback to summary
protected long beginTime
endExecutionTimeback to summary
protected long endExecutionTime
endTimeback to summary
protected long endTime
firstColumnback to summary
private int firstColumn
generatedColumnPositionsback to summary
private int[] generatedColumnPositions
isOpenback to summary
private boolean isOpen

True if the result set has been opened, and not yet closed.

lccback to summary
pack-priv final LanguageConnectionContext lcc
normalizedGeneratedValuesback to summary
private DataValueDescriptor[] normalizedGeneratedValues
statisticsTimingOnback to summary
private final boolean statisticsTimingOn
subqueryTrackingArrayback to summary
private NoPutResultSet[] subqueryTrackingArray

Constructor Detail

NoRowsResultSetImplback to summary
pack-priv NoRowsResultSetImpl(Activation activation)

Method Detail

addWarningback to summary
public 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

checkRowPositionback to summary
public final boolean checkRowPosition(int isType)

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.

clearCurrentRowback to summary
public final void clearCurrentRow()

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

Clear the current row. This is done after a commit on holdable result sets. This is a no-op on result set which do not provide rows.

closeback to summary
public void close(boolean underMerge) throws StandardException

Dump the stat if not already done so. Close all of the open subqueries.

Parameters
underMerge:boolean

True if this is part of an action of a MERGE statement.

Exceptions
StandardException:
thrown on error
doesCommitback to summary
public boolean doesCommit()

Does this ResultSet cause a commit or rollback.

Returns:boolean

Whether or not this ResultSet cause a commit or rollback.

evaluateGenerationClausesback to summary
public void evaluateGenerationClauses(GeneratedMethod generationClauses, Activation activation, NoPutResultSet source, ExecRow newRow, boolean isUpdate) throws StandardException

Compute the generation clauses on the current row in order to fill in computed columns.

Parameters
generationClauses:GeneratedMethod

the generated method which evaluates generation clauses

activation:Activation

the thread-specific instance of the generated class

source:NoPutResultSet

the tuple stream driving this INSERT/UPDATE

newRow:ExecRow

the base row being stuffed

isUpdate:boolean

true if this is an UPDATE. false otherwise.

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
getAbsoluteRowback to summary
public final 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.

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.

getCursorNameback to summary
public String getCursorName()

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

Return the cursor name, null in this case.

Returns:String

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

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

See Also
ResultSet#getCursorName
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.

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.

getFirstRowback to summary
public final 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
getLastRowback to summary
public final 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.

No rows to return, so throw an exception.

Returns:ExecRow

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

The next row, or NULL if no more rows.

Exceptions
StandardException:
Always throws a StandardException to indicate that this method is not intended to be used.
getPreviousRowback to summary
public final 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
getQueryPlanTextback to summary
public String getQueryPlanText(int depth)

RESOLVE - This method will go away once it is overloaded in all subclasses. Return the query plan as a String.

Parameters
depth:int

Indentation level.

Returns:String

String The query plan as a String.

getRelativeRowback to summary
public final 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 null.

Returns:ResultDescription

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

A ResultDescription describing the results of the statement.

getRowNumberback to summary
public final 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

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
getTimeSpentback to summary
public long getTimeSpent(int type)

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

Return the total amount of time spent in this ResultSet

Parameters
type:int

CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.

Returns:long

long The total amount of time spent (in milliseconds).

getWarningsback to summary
public 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.

Find out if the ResultSet is closed.

Returns:boolean

true if closed, false otherwise

modifiedRowCountback to summary
public long modifiedRowCount()

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

Returns zero.

Returns:long

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

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

returnsRowsback to summary
public final boolean returnsRows()

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

Returns FALSE

Returns:boolean

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

TRUE if the statement returns rows, FALSE if not.

setAfterLastRowback to summary
public final 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 final 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
setupback to summary
pack-priv void setup() throws StandardException

Set up the result set for use. Should always be called from open().

Exceptions
StandardException:
thrown on error
setupGeneratedColumnsback to summary
private void setupGeneratedColumns(Activation activation, ValueRow newRow) throws StandardException

Construct support for normalizing generated columns. This figures out which columns in the target row have generation clauses which need to be run.

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