|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ execute overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.sql.execute
Class BasicNoPutResultSetImpl

java.lang.Objectorg.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
- All Implemented Interfaces:
- org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.ResultSet, org.apache.derby.iapi.store.access.RowLocationRetRowSource, org.apache.derby.iapi.store.access.RowSource
- Direct Known Subclasses:
- NoPutResultSetImpl
- abstract class BasicNoPutResultSetImpl
- extends java.lang.Object
- implements org.apache.derby.iapi.sql.execute.NoPutResultSet
- extends java.lang.Object
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.
| Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet |
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE |
| Fields inherited from interface org.apache.derby.iapi.sql.ResultSet |
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST |
| Constructor Summary | |
(package private) |
BasicNoPutResultSetImpl(org.apache.derby.iapi.sql.ResultDescription resultDescription,
org.apache.derby.iapi.sql.Activation activation,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
Constructor. |
| Method Summary | |
protected void |
addWarning(java.sql.SQLWarning w)
|
protected void |
attachStatementContext()
Attach this result set to the top statement context on the stack. |
boolean |
checkRowPosition(int isType)
Determine if the cursor is before the first row in the result set. |
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. |
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()
|
org.apache.derby.iapi.sql.execute.ExecRow |
getAbsoluteRow(int row)
Returns the row at the absolute position from the query, and returns NULL when there is no such position. |
org.apache.derby.iapi.sql.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 org.apache.derby.iapi.sql.execute.ExecRow |
getCompactRow(org.apache.derby.iapi.sql.execute.ExecRow candidate,
org.apache.derby.iapi.services.io.FormatableBitSet accessedCols,
org.apache.derby.iapi.services.io.FormatableBitSet otherCols,
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) org.apache.derby.iapi.sql.execute.ExecutionFactory |
getExecutionFactory()
Get a execution factory |
org.apache.derby.iapi.sql.execute.ExecRow |
getFirstRow()
Returns the first row from the query, and returns NULL when there are no rows. |
protected org.apache.derby.iapi.sql.conn.LanguageConnectionContext |
getLanguageConnectionContext()
Cache the language connection context. |
org.apache.derby.iapi.sql.execute.ExecRow |
getLastRow()
Returns the last row from the query, and returns NULL when there are no rows. |
org.apache.derby.iapi.sql.execute.ExecRow |
getNextRow()
Return the requested values computed from the next row (if any) for which the restriction evaluates to true. |
abstract org.apache.derby.iapi.sql.execute.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. |
org.apache.derby.iapi.sql.execute.ExecRow |
getPreviousRow()
Returns the previous row from the query, and returns NULL when there are no more previous rows. |
org.apache.derby.iapi.sql.execute.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. |
org.apache.derby.iapi.sql.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. |
org.apache.derby.iapi.sql.execute.NoPutResultSet[] |
getSubqueryTrackingArray(int numSubqueries)
Get the subquery ResultSet tracking array from the top ResultSet. |
(package private) org.apache.derby.iapi.store.access.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 |
void |
markAsTopResultSet()
Mark the ResultSet as the topmost one in the ResultSet tree. |
int |
modifiedRowCount()
Returns the number of rows affected by the statement. |
void |
open()
open a scan on the table. |
abstract void |
openCore()
open a scan on the table. |
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. |
org.apache.derby.iapi.sql.execute.ExecRow |
setAfterLastRow()
Sets the current position to after the last row and returns NULL because there is no current row. |
org.apache.derby.iapi.sql.execute.ExecRow |
setBeforeFirstRow()
Sets the current position to before the first row and returns NULL because there is no current row. |
protected org.apache.derby.iapi.sql.execute.ExecRow |
setCompactRow(org.apache.derby.iapi.sql.execute.ExecRow candidateRow,
org.apache.derby.iapi.sql.execute.ExecRow compactRow)
Copy columns from the candidate row from the store to the given compact row. |
protected void |
setCompatRow(org.apache.derby.iapi.sql.execute.ExecRow compactRow,
java.lang.Object[] sourceRow)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet |
clearCurrentRow, setCurrentRow, setNeedsRowLocation, setTargetResultSet |
| Methods inherited from interface org.apache.derby.iapi.sql.ResultSet |
close, getCursorName, getTimeSpent |
| Methods inherited from interface org.apache.derby.iapi.store.access.RowLocationRetRowSource |
needsRowLocation, rowLocation |
| Methods inherited from interface org.apache.derby.iapi.store.access.RowSource |
closeRowSource, getNextRowFromRowSource, getValidColumns, needsToClone |
| Field Detail |
isOpen
protected boolean isOpen
finished
protected boolean finished
currentRow
protected org.apache.derby.iapi.sql.execute.ExecRow currentRow
isTopResultSet
protected boolean isTopResultSet
lcc
protected org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc
warnings
private java.sql.SQLWarning warnings
numOpens
public int numOpens
rowsSeen
public int rowsSeen
rowsFiltered
public int rowsFiltered
startExecutionTime
protected long startExecutionTime
endExecutionTime
protected long endExecutionTime
beginTime
public long beginTime
constructorTime
public long constructorTime
openTime
public long openTime
nextTime
public long nextTime
closeTime
public long closeTime
optimizerEstimatedRowCount
public double optimizerEstimatedRowCount
optimizerEstimatedCost
public double optimizerEstimatedCost
statementContext
private org.apache.derby.iapi.sql.conn.StatementContext statementContext
subqueryTrackingArray
public org.apache.derby.iapi.sql.execute.NoPutResultSet[] subqueryTrackingArray
compactRow
org.apache.derby.iapi.sql.execute.ExecRow compactRow
activation
protected org.apache.derby.iapi.sql.Activation activation
statisticsTimingOn
private boolean statisticsTimingOn
resultDescription
org.apache.derby.iapi.sql.ResultDescription resultDescription
exFactory
private transient org.apache.derby.iapi.sql.execute.ExecutionFactory exFactory
tc
private transient org.apache.derby.iapi.store.access.TransactionController tc
baseColumnMap
private int[] baseColumnMap
| Constructor Detail |
BasicNoPutResultSetImpl
BasicNoPutResultSetImpl(org.apache.derby.iapi.sql.ResultDescription resultDescription, org.apache.derby.iapi.sql.Activation activation, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
- Constructor.
Sets beginTime for all children to use to measue constructor time.
| Method Detail |
openCore
public abstract void openCore()
throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - open a scan on the table. scan parameters are evaluated
at each open, so there is probably some way of altering
their values...
openCore() can only be called on a closed result set. see reopenCore if you want to reuse an open result set.
- Specified by:
openCorein interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
reopenCore
public void reopenCore()
throws org.apache.derby.iapi.error.StandardException
- 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.
- Specified by:
reopenCorein interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
getNextRowCore
public abstract org.apache.derby.iapi.sql.execute.ExecRow getNextRowCore() throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - 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.
- Specified by:
getNextRowCorein interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
getPointOfAttachment
public int getPointOfAttachment()
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - 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:
getPointOfAttachmentin interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
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:
markAsTopResultSetin interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
getScanIsolationLevel
public int getScanIsolationLevel()
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - 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:
getScanIsolationLevelin interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
getEstimatedRowCount
public double getEstimatedRowCount()
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - Get the estimated row count from this result set.
- Specified by:
getEstimatedRowCountin interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
requiresRelocking
public boolean requiresRelocking()
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - Do we need to relock the row when going to the heap.
- Specified by:
requiresRelockingin interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
open
public final void open()
throws org.apache.derby.iapi.error.StandardException
- 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.
- Specified by:
openin interfaceorg.apache.derby.iapi.sql.ResultSet
getAbsoluteRow
public org.apache.derby.iapi.sql.execute.ExecRow getAbsoluteRow(int row) throws org.apache.derby.iapi.error.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:
getAbsoluteRowin interfaceorg.apache.derby.iapi.sql.ResultSet
getRelativeRow
public org.apache.derby.iapi.sql.execute.ExecRow getRelativeRow(int row) throws org.apache.derby.iapi.error.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:
getRelativeRowin interfaceorg.apache.derby.iapi.sql.ResultSet
setBeforeFirstRow
public org.apache.derby.iapi.sql.execute.ExecRow setBeforeFirstRow() throws org.apache.derby.iapi.error.StandardException
- Sets the current position to before the first row and returns NULL
because there is no current row.
- Specified by:
setBeforeFirstRowin interfaceorg.apache.derby.iapi.sql.ResultSet
checkRowPosition
public boolean checkRowPosition(int isType)
throws org.apache.derby.iapi.error.StandardException
- Determine if the cursor is before the first row in the result
set.
- Specified by:
checkRowPositionin interfaceorg.apache.derby.iapi.sql.ResultSet
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:
getRowNumberin interfaceorg.apache.derby.iapi.sql.ResultSet
getFirstRow
public org.apache.derby.iapi.sql.execute.ExecRow getFirstRow() throws org.apache.derby.iapi.error.StandardException
- Returns the first row from the query, and returns NULL when there
are no rows.
- Specified by:
getFirstRowin interfaceorg.apache.derby.iapi.sql.ResultSet
getNextRow
public final org.apache.derby.iapi.sql.execute.ExecRow getNextRow() throws org.apache.derby.iapi.error.StandardException
- 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.
- Specified by:
getNextRowin interfaceorg.apache.derby.iapi.sql.ResultSet
getPreviousRow
public org.apache.derby.iapi.sql.execute.ExecRow getPreviousRow() throws org.apache.derby.iapi.error.StandardException
- Returns the previous row from the query, and returns NULL when there
are no more previous rows.
- Specified by:
getPreviousRowin interfaceorg.apache.derby.iapi.sql.ResultSet
getLastRow
public org.apache.derby.iapi.sql.execute.ExecRow getLastRow() throws org.apache.derby.iapi.error.StandardException
- Returns the last row from the query, and returns NULL when there
are no rows.
- Specified by:
getLastRowin interfaceorg.apache.derby.iapi.sql.ResultSet
setAfterLastRow
public org.apache.derby.iapi.sql.execute.ExecRow setAfterLastRow() throws org.apache.derby.iapi.error.StandardException
- Sets the current position to after the last row and returns NULL
because there is no current row.
- Specified by:
setAfterLastRowin interfaceorg.apache.derby.iapi.sql.ResultSet
returnsRows
public boolean returnsRows()
- Returns true.
- Specified by:
returnsRowsin interfaceorg.apache.derby.iapi.sql.ResultSet
modifiedRowCount
public final int modifiedRowCount()
- Description copied from interface:
org.apache.derby.iapi.sql.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:
modifiedRowCountin interfaceorg.apache.derby.iapi.sql.ResultSet
cleanUp
public void cleanUp()
throws org.apache.derby.iapi.error.StandardException
- Clean up on error
- Specified by:
cleanUpin interfaceorg.apache.derby.iapi.sql.ResultSet
isClosed
public boolean isClosed()
- Report if closed.
- Specified by:
isClosedin interfaceorg.apache.derby.iapi.sql.ResultSet
finish
public void finish()
throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.sql.ResultSet - 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:
finishin interfaceorg.apache.derby.iapi.sql.ResultSet
finishAndRTS
protected final void finishAndRTS()
throws org.apache.derby.iapi.error.StandardException
getResultDescription
public org.apache.derby.iapi.sql.ResultDescription getResultDescription()
- Returns the description of the table's rows
- Specified by:
getResultDescriptionin interfaceorg.apache.derby.iapi.sql.ResultSet
getExecuteTime
public long getExecuteTime()
- Get the execution time in milliseconds.
- Specified by:
getExecuteTimein interfaceorg.apache.derby.iapi.sql.ResultSet
getBeginExecutionTimestamp
public java.sql.Timestamp getBeginExecutionTimestamp()
- Get the Timestamp for the beginning of execution.
- Specified by:
getBeginExecutionTimestampin interfaceorg.apache.derby.iapi.sql.ResultSet
getEndExecutionTimestamp
public java.sql.Timestamp getEndExecutionTimestamp()
- Get the Timestamp for the end of execution.
- Specified by:
getEndExecutionTimestampin interfaceorg.apache.derby.iapi.sql.ResultSet
getSubqueryTrackingArray
public final org.apache.derby.iapi.sql.execute.NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
- Description copied from interface:
org.apache.derby.iapi.sql.ResultSet - Get the subquery ResultSet tracking array from the top ResultSet.
(Used for tracking open subqueries when closing down on an error.)
- Specified by:
getSubqueryTrackingArrayin interfaceorg.apache.derby.iapi.sql.ResultSet
getCurrentTimeMillis
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.)
getAutoGeneratedKeysResultset
public org.apache.derby.iapi.sql.ResultSet getAutoGeneratedKeysResultset()
- Description copied from interface:
org.apache.derby.iapi.sql.ResultSet - ResultSet for rows inserted into the table (contains auto-generated keys columns only)
- Specified by:
getAutoGeneratedKeysResultsetin interfaceorg.apache.derby.iapi.sql.ResultSet
getElapsedMillis
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.)
dumpTimeStats
protected final java.lang.String dumpTimeStats(java.lang.String indent, java.lang.String subIndent)
- Dump out the time information for run time stats.
attachStatementContext
protected void attachStatementContext()
throws org.apache.derby.iapi.error.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.
getLanguageConnectionContext
protected final org.apache.derby.iapi.sql.conn.LanguageConnectionContext getLanguageConnectionContext()
- Cache the language connection context. Return it.
resultSetNumber
public int resultSetNumber()
- Description copied from interface:
org.apache.derby.iapi.sql.execute.NoPutResultSet - Get the number of this ResultSet, which is guaranteed to be unique
within a statement.
- Specified by:
resultSetNumberin interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
getExecutionFactory
final org.apache.derby.iapi.sql.execute.ExecutionFactory getExecutionFactory()
- Get a execution factory
getTransactionController
final org.apache.derby.iapi.store.access.TransactionController getTransactionController()
- Get the current transaction controller.
getCompactRow
protected org.apache.derby.iapi.sql.execute.ExecRow getCompactRow(org.apache.derby.iapi.sql.execute.ExecRow candidate, org.apache.derby.iapi.services.io.FormatableBitSet accessedCols, org.apache.derby.iapi.services.io.FormatableBitSet otherCols, boolean isKeyed) throws org.apache.derby.iapi.error.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.
setCompactRow
protected org.apache.derby.iapi.sql.execute.ExecRow setCompactRow(org.apache.derby.iapi.sql.execute.ExecRow candidateRow, org.apache.derby.iapi.sql.execute.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.
setCompatRow
protected final void setCompatRow(org.apache.derby.iapi.sql.execute.ExecRow compactRow, java.lang.Object[] sourceRow)
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:
isForUpdatein interfaceorg.apache.derby.iapi.sql.execute.NoPutResultSet
addWarning
protected final void addWarning(java.sql.SQLWarning w)
getWarnings
public final java.sql.SQLWarning getWarnings()
- Description copied from interface:
org.apache.derby.iapi.sql.ResultSet - Return the set of warnings generated during the execution of
this result set. The warnings are cleared once this call returns.
- Specified by:
getWarningsin interfaceorg.apache.derby.iapi.sql.ResultSet
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ execute overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl