Class CurrentOfResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.CurrentOfResultSet
- All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
Takes a cursor name and returns the current row
of the cursor; for use in generating the source
row and row location for positioned update/delete operations.
This result set returns only one row.
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CursorResultSetprivate final Stringprivate booleanprivate RowLocationprivate ExecRowprivate CursorResultSetFields inherited from class NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSetFields inherited from class BasicNoPutResultSetImpl
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArrayFields inherited from interface NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBERFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionCurrentOfResultSet(String cursorName, Activation activation, int resultSetNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()If the result set has been opened, close the open scan.voidfinish()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().Returns the current row of the result set.private voidBecause the positioned operation only gets one location per execution, and the cursor could be completely different for each execution (closed and reopened, perhaps), we determine where caching the cursor could be applied.If open and not returned yet, returns the row.This result set has its row location from the last fetch done.private ExecRowgetSparseRow(ExecRow row, int[] indexCols) Return a sparse heap row, based on a compact index row.longgetTimeSpent(int type) Return the total amount of time spent in this ResultSetvoidMarks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.voidopenCore()open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...voidupdateRow(ExecRow row, RowChanger rowChanger) Updates the resultSet's current row with it's new values after an update has been issued either using positioned update or JDBC's udpateRow method.Methods inherited from class NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValueMethods inherited from class BasicNoPutResultSetImpl
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, childrenToXML, cleanUp, dumpTimeStats, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPointOfAttachment, getPreviousRow, getRelativeRow, getRowNumber, getScanIsolationLevel, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, reopenCore, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML, toXMLMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSet
addWarning, checkRowPosition, cleanUp, clearCurrentRow, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
next
private boolean next -
rowLocation
-
cursor
-
target
-
sparseRow
-
cursorName
-
-
Constructor Details
-
CurrentOfResultSet
CurrentOfResultSet(String cursorName, Activation activation, int resultSetNumber)
-
-
Method Details
-
openCore
open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
openCorein interfaceNoPutResultSet- Throws:
StandardException- thrown on failure to open
-
getNextRowCore
If open and not returned yet, returns the row.- Specified by:
getNextRowCorein interfaceNoPutResultSet- Specified by:
getNextRowCorein classBasicNoPutResultSetImpl- Returns:
- the next row in the result
- Throws:
StandardException- thrown on failure.- See Also:
-
getSparseRow
Return a sparse heap row, based on a compact index row.- Parameters:
row- compact referenced index rowindexCols- base column positions of index keys, signed with asc/desc info- Returns:
- a sparse heap row with referenced columns
- Throws:
StandardException
-
close
If the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Overrides:
closein classNoPutResultSetImpl- Throws:
StandardException- thrown on error
-
finish
Description copied from interface:ResultSetTells 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 interfaceResultSet- Overrides:
finishin classBasicNoPutResultSetImpl- Throws:
StandardException- on error
-
getTimeSpent
public long getTimeSpent(int type) Return the total amount of time spent in this ResultSet- Specified by:
getTimeSpentin interfaceResultSet- Parameters:
type- CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.- Returns:
- long The total amount of time spent (in milliseconds).
-
getRowLocation
This result set has its row location from the last fetch done. If it is closed, a null is returned.- Specified by:
getRowLocationin interfaceCursorResultSet- Returns:
- the row location of the current row.
- Throws:
StandardException- thrown on failure to get row location- See Also:
-
getCurrentRow
Description copied from interface:CursorResultSetReturns the current row of the result set. REMIND: eventually, this will only return the current row for result sets that need to return it; either some field in the activation or a parameter in the constructor will be used to signal that this needs to function. This will let us limit the number of live objects we are holding on to.- Specified by:
getCurrentRowin interfaceCursorResultSet- Returns:
- the last row returned by getNextRow.
- See Also:
-
getCursor
Because the positioned operation only gets one location per execution, and the cursor could be completely different for each execution (closed and reopened, perhaps), we determine where caching the cursor could be applied.When cached, we check if the cursor was closed'd, and if so, throw it out and see if there's one in the cache with our name.
- Throws:
StandardException
-
updateRow
Description copied from interface:NoPutResultSetUpdates the resultSet's current row with it's new values after an update has been issued either using positioned update or JDBC's udpateRow method.- Specified by:
updateRowin interfaceNoPutResultSet- Overrides:
updateRowin classNoPutResultSetImpl- Parameters:
row- new values for the currentRowrowChanger- holds information about row: what columns of it is to be used for updating, and what underlying base table column each such column corresponds to.- Throws:
StandardException- thrown on failure.- See Also:
-
markRowAsDeleted
Description copied from interface:NoPutResultSetMarks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.- Specified by:
markRowAsDeletedin interfaceNoPutResultSet- Overrides:
markRowAsDeletedin classNoPutResultSetImpl- Throws:
StandardException- thrown on failure.- See Also:
-