abstract class BasicNoPutResultSetImpl extends java.lang.Object implements NoPutResultSet
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.
Modifier and Type | Class and Description |
---|---|
static class |
BasicNoPutResultSetImpl.FieldComparator |
Modifier and Type | Field and Description |
---|---|
protected Activation |
activation |
private int[] |
baseColumnMap |
long |
beginTime |
long |
closeTime |
(package private) ExecRow |
compactRow |
long |
constructorTime |
protected ExecRow |
currentRow |
protected long |
endExecutionTime |
protected boolean |
finished |
protected boolean |
isOpen |
protected boolean |
isTopResultSet |
long |
nextTime |
int |
numOpens |
long |
openTime |
double |
optimizerEstimatedCost |
double |
optimizerEstimatedRowCount |
(package private) ResultDescription |
resultDescription |
int |
rowsFiltered |
int |
rowsSeen |
protected long |
startExecutionTime |
private StatementContext |
statementContext |
private boolean |
statisticsTimingOn |
NoPutResultSet[] |
subqueryTrackingArray |
private TransactionController |
tc |
private java.sql.SQLWarning |
warnings |
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBER
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
Constructor and Description |
---|
BasicNoPutResultSetImpl(ResultDescription resultDescription,
Activation activation,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addWarning(java.sql.SQLWarning w)
Add a warning to this result set.
|
protected void |
attachStatementContext()
Attach this result set to the top statement context on the stack.
|
void |
checkCancellationFlag()
Checks whether the currently executing statement has been cancelled.
|
boolean |
checkRowPosition(int isType)
Determine if the cursor is before the first row in the result
set.
|
static org.w3c.dom.Element |
childrenToXML(org.w3c.dom.Element outerNode,
ResultSet outerRS)
Pretty-print the inner ResultSet fields inside an outer ResultSet.
|
void |
cleanUp()
Clean up on error
|
protected java.lang.String |
dumpTimeStats(java.lang.String indent,
java.lang.String subIndent)
Dump out the time information for run time stats.
|
private static void |
findResultSetFields(java.util.ArrayList<java.lang.reflect.Field> fieldList,
java.lang.Class<?> klass)
Find all fields of type ResultSet.
|
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().
|
protected void |
finishAndRTS() |
ExecRow |
getAbsoluteRow(int row)
Returns the row at the absolute position from the query,
and returns NULL when there is no such position.
|
Activation |
getActivation() |
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.
|
protected ExecRow |
getCompactRow(ExecRow candidate,
FormatableBitSet accessedCols,
boolean isKeyed)
Get a compacted version of the candidate row according to the
columns specified in the bit map.
|
protected long |
getCurrentTimeMillis()
Return the current time in milliseconds, if DEBUG and RunTimeStats is
on, else return 0.
|
protected long |
getElapsedMillis(long beginTime)
Return the elapsed time in milliseconds, between now and the beginTime, if
DEBUG and RunTimeStats is on, else return 0.
|
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.
|
(package private) ExecutionFactory |
getExecutionFactory()
Get a execution factory
|
ExecRow |
getFirstRow()
Returns the first row from the query, and returns NULL when there
are no rows.
|
protected LanguageConnectionContext |
getLanguageConnectionContext()
Cache the language connection context.
|
ExecRow |
getLastRow()
Returns the last row from the query, and returns NULL when there
are no rows.
|
ExecRow |
getNextRow()
Return the requested values computed
from the next row (if any) for which
the restriction evaluates to true.
|
abstract ExecRow |
getNextRowCore()
Return the requested values computed
from the next row (if any) for which
the restriction evaluates to true.
|
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 the description of the table's rows
|
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.
|
(package private) TransactionController |
getTransactionController()
Get the current transaction controller.
|
java.sql.SQLWarning |
getWarnings()
Return the set of warnings generated during the execution of
this result set.
|
boolean |
isClosed()
Report if closed.
|
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
|
protected boolean |
isXplainOnlyMode() |
void |
markAsTopResultSet()
Mark the ResultSet as the topmost one in the ResultSet tree.
|
long |
modifiedRowCount()
Returns the number of rows affected by the statement.
|
void |
open()
open a scan on the table. scan parameters are evaluated
at each open, so there is probably some way of altering
their values...
|
protected void |
recordConstructorTime()
Allow sub-classes to record the total
time spent in their constructor time.
|
void |
reopenCore()
This is the default implementation of reopenCore().
|
boolean |
requiresRelocking()
Do we need to relock the row when going to the heap.
|
int |
resultSetNumber()
Get the number of this ResultSet, which is guaranteed to be unique
within a statement.
|
boolean |
returnsRows()
Returns true.
|
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.
|
protected ExecRow |
setCompactRow(ExecRow candidateRow,
ExecRow compactRow)
Copy columns from the candidate row from the store to the given
compact row.
|
protected void |
setCompatRow(ExecRow compactRow,
DataValueDescriptor[] sourceRow) |
private static java.lang.String |
stripPackage(java.lang.String className)
Strip the package location from a class name
|
org.w3c.dom.Element |
toXML(org.w3c.dom.Element parentNode,
java.lang.String tag)
Produce an xml image of this ResultSet and its descendant ResultSets.
|
static org.w3c.dom.Element |
toXML(org.w3c.dom.Element parentNode,
java.lang.String childTag,
ResultSet rs)
Pretty-print a ResultSet as an xml child of a parent node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
markRowAsDeleted, openCore, positionScanAtRowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, updateRow
clearCurrentRow, close, getCursorName, getTimeSpent
needsRowLocation, needsRowLocationForDeferredCheckConstraints, offendingRowLocation, rowLocation
closeRowSource, getNextRowFromRowSource, getValidColumns, needsToClone
protected boolean isOpen
protected boolean finished
protected ExecRow currentRow
protected boolean isTopResultSet
private java.sql.SQLWarning warnings
public int numOpens
public int rowsSeen
public int rowsFiltered
protected long startExecutionTime
protected long endExecutionTime
public long beginTime
public long constructorTime
public long openTime
public long nextTime
public long closeTime
public double optimizerEstimatedRowCount
public double optimizerEstimatedCost
private StatementContext statementContext
public NoPutResultSet[] subqueryTrackingArray
ExecRow compactRow
protected final Activation activation
private final boolean statisticsTimingOn
ResultDescription resultDescription
private transient TransactionController tc
private int[] baseColumnMap
BasicNoPutResultSetImpl(ResultDescription resultDescription, Activation activation, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
resultDescription
- the result description. May be null.activation
- The activationoptimizerEstimatedRowCount
- The optimizer's estimate of the
total number of rows for this
result setoptimizerEstimatedCost
- The optimizer's estimated cost for
this result setprotected final void recordConstructorTime()
public final Activation getActivation()
getActivation
in interface ResultSet
protected final boolean isXplainOnlyMode()
public void reopenCore() throws StandardException
reopenCore
in interface NoPutResultSet
StandardException
- thrown if cursor finished.NoPutResultSet.openCore()
public abstract ExecRow getNextRowCore() throws StandardException
NoPutResultSet
restriction and projection parameters are evaluated for each row.
getNextRowCore
in interface NoPutResultSet
StandardException
- thrown if cursor finished.NoPutResultSet.getNextRowCore()
public int getPointOfAttachment()
NoPutResultSet
getPointOfAttachment
in interface NoPutResultSet
NoPutResultSet.getPointOfAttachment()
public void markAsTopResultSet()
markAsTopResultSet
in interface NoPutResultSet
public int getScanIsolationLevel()
NoPutResultSet
getScanIsolationLevel
in interface NoPutResultSet
NoPutResultSet.getScanIsolationLevel()
public double getEstimatedRowCount()
NoPutResultSet
getEstimatedRowCount
in interface NoPutResultSet
NoPutResultSet.getEstimatedRowCount()
public boolean requiresRelocking()
NoPutResultSet
requiresRelocking
in interface NoPutResultSet
NoPutResultSet.requiresRelocking()
public final void open() throws StandardException
open
in interface ResultSet
StandardException
- thrown if cursor finished.public ExecRow getAbsoluteRow(int row) throws StandardException
getAbsoluteRow
in interface ResultSet
row
- The position.StandardException
- Thrown on failureRow
public ExecRow getRelativeRow(int row) throws StandardException
getRelativeRow
in interface ResultSet
row
- The position.StandardException
- Thrown on failureRow
public ExecRow setBeforeFirstRow() throws StandardException
setBeforeFirstRow
in interface ResultSet
StandardException
- Thrown on failureRow
public boolean checkRowPosition(int isType) throws StandardException
checkRowPosition
in interface ResultSet
StandardException
- Thrown on error.public int getRowNumber()
getRowNumber
in interface ResultSet
public ExecRow getFirstRow() throws StandardException
getFirstRow
in interface ResultSet
StandardException
- Thrown on failureRow
public final ExecRow getNextRow() throws StandardException
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.
getNextRow
in interface ResultSet
StandardException
- thrown on failure.StandardException
- ResultSetNotOpen thrown if not yet open.Row
public ExecRow getPreviousRow() throws StandardException
getPreviousRow
in interface ResultSet
StandardException
- Thrown on failureRow
public ExecRow getLastRow() throws StandardException
getLastRow
in interface ResultSet
StandardException
- Thrown on failureRow
public ExecRow setAfterLastRow() throws StandardException
setAfterLastRow
in interface ResultSet
StandardException
- Thrown on failureRow
public boolean returnsRows()
returnsRows
in interface ResultSet
public final long modifiedRowCount()
ResultSet
modifiedRowCount
in interface ResultSet
public void cleanUp() throws StandardException
cleanUp
in interface ResultSet
StandardException
- Thrown on failurepublic boolean isClosed()
public void finish() throws StandardException
ResultSet
finish
in interface ResultSet
StandardException
- on errorprotected final void finishAndRTS() throws StandardException
StandardException
- on errorpublic ResultDescription getResultDescription()
getResultDescription
in interface ResultSet
public long getExecuteTime()
getExecuteTime
in interface ResultSet
public java.sql.Timestamp getBeginExecutionTimestamp()
getBeginExecutionTimestamp
in interface ResultSet
public java.sql.Timestamp getEndExecutionTimestamp()
getEndExecutionTimestamp
in interface ResultSet
public final NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
ResultSet
getSubqueryTrackingArray
in interface ResultSet
numSubqueries
- The size of the array (For allocation on demand.)ResultSet.getSubqueryTrackingArray(int)
protected final long getCurrentTimeMillis()
public ResultSet getAutoGeneratedKeysResultset()
ResultSet
getAutoGeneratedKeysResultset
in interface ResultSet
ResultSet.getAutoGeneratedKeysResultset()
protected final long getElapsedMillis(long beginTime)
protected final java.lang.String dumpTimeStats(java.lang.String indent, java.lang.String subIndent)
protected void attachStatementContext() throws StandardException
StandardException
- thrown if cursor finished.protected final LanguageConnectionContext getLanguageConnectionContext()
public int resultSetNumber()
NoPutResultSet
resultSetNumber
in interface NoPutResultSet
NoPutResultSet.resultSetNumber()
final ExecutionFactory getExecutionFactory()
final TransactionController getTransactionController()
protected ExecRow getCompactRow(ExecRow candidate, FormatableBitSet accessedCols, boolean isKeyed) throws StandardException
candidate
- The row to get the columns fromaccessedCols
- A bit map of the columns that are accessed in
the candidate rowisKeyed
- Tells whether to return a ValueRow or an IndexRowStandardException
protected ExecRow setCompactRow(ExecRow candidateRow, ExecRow compactRow)
candidateRow
- The candidate row from the storecompactRow
- The compact row to fill inprotected final void setCompatRow(ExecRow compactRow, DataValueDescriptor[] sourceRow)
public boolean isForUpdate()
isForUpdate
in interface NoPutResultSet
public void checkCancellationFlag() throws StandardException
StandardException
StatementContext
public final void addWarning(java.sql.SQLWarning w)
ResultSet
addWarning
in interface ResultSet
w
- the warning to addpublic final java.sql.SQLWarning getWarnings()
ResultSet
getWarnings
in interface ResultSet
public org.w3c.dom.Element toXML(org.w3c.dom.Element parentNode, java.lang.String tag) throws java.lang.Exception
ResultSet
Produce an xml image of this ResultSet and its descendant ResultSets. Appends an element to the parentNode and returns the appended element.
public static org.w3c.dom.Element toXML(org.w3c.dom.Element parentNode, java.lang.String childTag, ResultSet rs) throws java.lang.Exception
Pretty-print a ResultSet as an xml child of a parent node. Return the node representing the ResultSet child.
java.lang.Exception
private static java.lang.String stripPackage(java.lang.String className)
public static org.w3c.dom.Element childrenToXML(org.w3c.dom.Element outerNode, ResultSet outerRS) throws java.lang.Exception
Pretty-print the inner ResultSet fields inside an outer ResultSet. Returns the outerNode.
java.lang.Exception
private static void findResultSetFields(java.util.ArrayList<java.lang.reflect.Field> fieldList, java.lang.Class<?> klass) throws java.lang.Exception
Find all fields of type ResultSet.
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.