Class OnceResultSet
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.OnceResultSet
-
- All Implemented Interfaces:
- NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
public class OnceResultSet extends java.lang.ObjectTakes an expression subquery's result set and verifies that only a single scalar value is being returned. NOTE: A row with a single column containing null will be returned from getNextRow() if the underlying subquery ResultSet is empty.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classBasicNoPutResultSetImpl.FieldComparator
-
Field Summary
Fields Modifier and Type Field and Description longbeginTimelongcloseTimelongconstructorTimestatic intDO_CARDINALITY_CHECKlongnextTimestatic intNO_CARDINALITY_CHECKintnumOpenslongopenTimedoubleoptimizerEstimatedCostdoubleoptimizerEstimatedRowCountintpointOfAttachmentintresultSetNumberintrowsFilteredintrowsSeenNoPutResultSetsourceintsubqueryNumberNoPutResultSet[]subqueryTrackingArraystatic intUNIQUE_CARDINALITY_CHECK-
Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBER
-
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
-
Constructor Summary
Constructors Constructor and Description OnceResultSet(NoPutResultSet s, Activation a, GeneratedMethod emptyRowFun, int cardinalityCheck, int resultSetNumber, int subqueryNumber, int pointOfAttachment, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddWarning(java.sql.SQLWarning w)Add a warning to this result set.voidcheckCancellationFlag()Checks whether the currently executing statement has been cancelled.booleancheckRowPosition(int isType)Determine if the cursor is before the first row in the result set.static org.w3c.dom.ElementchildrenToXML(org.w3c.dom.Element outerNode, ResultSet outerRS)Pretty-print the inner ResultSet fields inside an outer ResultSet.voidcleanUp()Clean up on errorvoidclearCurrentRow()Clear the current rowvoidclose()If the result set has been opened, close the open scan.voidcloseRowSource()closeRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have.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().ExecRowgetAbsoluteRow(int row)Returns the row at the absolute position from the query, and returns NULL when there is no such position.ActivationgetActivation()ResultSetgetAutoGeneratedKeysResultset()ResultSet for rows inserted into the table (contains auto-generated keys columns only)java.sql.TimestampgetBeginExecutionTimestamp()Get the Timestamp for the beginning of execution.java.lang.StringgetCursorName()Return my cursor name for JDBC.java.sql.TimestampgetEndExecutionTimestamp()Get the Timestamp for the end of execution.doublegetEstimatedRowCount()Get the estimated row count from this result set.longgetExecuteTime()Get the execution time in milliseconds.ExecRowgetFirstRow()Returns the first row from the query, and returns NULL when there are no rows.ExecRowgetLastRow()Returns the last row from the query, and returns NULL when there are no rows.ExecRowgetNextRow()Return the requested values computed from the next row (if any) for which the restriction evaluates to true.ExecRowgetNextRowCore()Return the requested value computed from the next row.DataValueDescriptor[]getNextRowFromRowSource()Get the next row as an array of column objects.intgetPointOfAttachment()Return the point of attachment for this subquery.ExecRowgetPreviousRow()Returns the previous row from the query, and returns NULL when there are no more previous rows.ExecRowgetRelativeRow(int row)Returns the row at the relative position from the current cursor position, and returns NULL when there is no such position.ResultDescriptiongetResultDescription()Returns the description of the table's rowsintgetRowNumber()Returns the row number of the current row.intgetScanIsolationLevel()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.longgetTimeSpent(int type)Return the total amount of time spent in this ResultSetFormatableBitSetgetValidColumns()getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call.java.sql.SQLWarninggetWarnings()Return the set of warnings generated during the execution of this result set.booleanisClosed()Report if closed.booleanisForUpdate()Is this ResultSet or it's source result set for update This method will be overriden in the inherited Classes if it is truevoidmarkAsTopResultSet()Mark the ResultSet as the topmost one in the ResultSet tree.voidmarkRowAsDeleted()Marks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.longmodifiedRowCount()Returns the number of rows affected by the statement.booleanneedsRowLocation()needsRowLocation returns true iff this the row source expects the drainer of the row source to call rowLocation after getting a row from getNextRowFromRowSource.booleanneedsRowLocationForDeferredCheckConstraints()booleanneedsToClone()Does the caller of getNextRowFromRowSource() need to clone the row in order to keep a reference to the row past the getNextRowFromRowSource() call which returned the row.voidoffendingRowLocation(RowLocation rl, long containdId)voidopen()open a scan on the table.voidopenCore()open a scan on the table.voidpositionScanAtRowLocation(RowLocation rl)Positions the cursor in the specified rowLocation.static java.lang.StringprintQualifiers(Qualifier[][] qualifiers)Return a 2-d array of Qualifiers as a StringvoidreopenCore()reopen a scan on the table.booleanrequiresRelocking()Do we need to relock the row when going to the heap.intresultSetNumber()Get the number of this ResultSet, which is guaranteed to be unique within a statement.booleanreturnsRows()Returns true.voidrowLocation(RowLocation rl)rowLocation is a callback for the drainer of the row source to return the rowLocation of the current row, i.e, the row that is being returned by getNextRowFromRowSource.ExecRowsetAfterLastRow()Sets the current position to after the last row and returns NULL because there is no current row.ExecRowsetBeforeFirstRow()Sets the current position to before the first row and returns NULL because there is no current row.voidsetCurrentRow(ExecRow row)Set the current row to the row passed in.voidsetHasDeferrableChecks()Set that we are acting on behalf of an insert result set that has deferrable check constraintsvoidsetNeedsRowLocation(boolean needsRowLocation)Set whether or not the NPRS need the row location when acting as a row source.voidsetTargetResultSet(TargetResultSet trs)Notify a NPRS that it is the source for the specified TargetResultSet.org.w3c.dom.ElementtoXML(org.w3c.dom.Element parentNode, java.lang.String tag)Produce an xml image of this ResultSet and its descendant ResultSets.static org.w3c.dom.ElementtoXML(org.w3c.dom.Element parentNode, java.lang.String childTag, ResultSet rs)Pretty-print a ResultSet as an xml child of a parent node.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.
-
-
-
Field Detail
-
DO_CARDINALITY_CHECK
public static final int DO_CARDINALITY_CHECK
- See Also:
- Constant Field Values
-
NO_CARDINALITY_CHECK
public static final int NO_CARDINALITY_CHECK
- See Also:
- Constant Field Values
-
UNIQUE_CARDINALITY_CHECK
public static final int UNIQUE_CARDINALITY_CHECK
- See Also:
- Constant Field Values
-
source
public NoPutResultSet source
-
subqueryNumber
public int subqueryNumber
-
pointOfAttachment
public int pointOfAttachment
-
resultSetNumber
public final int resultSetNumber
-
numOpens
public int numOpens
-
rowsSeen
public int rowsSeen
-
rowsFiltered
public int rowsFiltered
-
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
-
subqueryTrackingArray
public NoPutResultSet[] subqueryTrackingArray
-
-
Constructor Detail
-
OnceResultSet
public OnceResultSet(NoPutResultSet s, Activation a, GeneratedMethod emptyRowFun, int cardinalityCheck, int resultSetNumber, int subqueryNumber, int pointOfAttachment, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
-
-
Method Detail
-
openCore
public void openCore() throws StandardExceptionopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Throws:
StandardException- thrown if cursor finished.
-
reopenCore
public void reopenCore() throws StandardExceptionreopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
reopenCorein interfaceNoPutResultSet- Throws:
StandardException- thrown if cursor finished.- See Also:
NoPutResultSet.openCore()
-
getNextRowCore
public ExecRow getNextRowCore() throws StandardException
Return the requested value computed from the next row.- Specified by:
getNextRowCorein interfaceNoPutResultSet- Returns:
- the next row in the result
- Throws:
StandardException- thrown on failure. StandardException ScalarSubqueryCardinalityViolation Thrown if scalar subquery returns more than 1 row.- See Also:
NoPutResultSet.getNextRowCore()
-
close
public void close() throws StandardExceptionIf the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Throws:
StandardException- thrown on error
-
getPointOfAttachment
public int getPointOfAttachment()
Description copied from interface:NoPutResultSetReturn 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 interfaceNoPutResultSet- Returns:
- int Point of attachment (result set number) for this subquery. (-1 if not a subquery - also Sanity violation)
- See Also:
NoPutResultSet.getPointOfAttachment()
-
getTimeSpent
public long getTimeSpent(int type)
Return the total amount of time spent in this ResultSet- 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).
-
getResultDescription
public ResultDescription getResultDescription()
Returns the description of the table's rows- Specified by:
getResultDescriptionin interfaceResultSet- Returns:
- A ResultDescription describing the results of the statement.
-
getCursorName
public java.lang.String getCursorName()
Return my cursor name for JDBC. Can be null.- Returns:
- A String with the name of the cursor, if any. Returns NULL if this is not a cursor statement.
-
resultSetNumber
public int resultSetNumber()
Description copied from interface:NoPutResultSetGet the number of this ResultSet, which is guaranteed to be unique within a statement.- Specified by:
resultSetNumberin interfaceNoPutResultSet- See Also:
NoPutResultSet.resultSetNumber()
-
setTargetResultSet
public void setTargetResultSet(TargetResultSet trs)
Description copied from interface:NoPutResultSetNotify a NPRS that it is the source for the specified TargetResultSet. This is useful when doing bulk insert.- Parameters:
trs- The TargetResultSet.- See Also:
NoPutResultSet.setTargetResultSet(org.apache.derby.iapi.sql.execute.TargetResultSet)
-
setNeedsRowLocation
public void setNeedsRowLocation(boolean needsRowLocation)
Description copied from interface:NoPutResultSetSet whether or not the NPRS need the row location when acting as a row source. (The target result set determines this.)
-
setHasDeferrableChecks
public void setHasDeferrableChecks()
Description copied from interface:NoPutResultSetSet that we are acting on behalf of an insert result set that has deferrable check constraints
-
getValidColumns
public FormatableBitSet getValidColumns()
Description copied from interface:RowSourcegetValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call. If getValidColumns returns null, the number of columns is given by the DataValueDescriptor.length where DataValueDescriptor[] is returned by the preceeding getNextRowFromRowSource() call. Column N maps to DataValueDescriptor[N], where column numbers start at zero. If getValidColumns return a non null validColumns FormatableBitSet the number of columns is given by the number of bits set in validColumns. Column N is not in the partial row if validColumns.get(N) returns false. Column N is in the partial row if validColumns.get(N) returns true. If column N is in the partial row then it maps to DataValueDescriptor[M] where M is the count of calls to validColumns.get(i) that return true where i < N. If DataValueDescriptor.length is greater than the number of columns indicated by validColumns the extra entries are ignored.- See Also:
RowSource.getValidColumns()
-
getNextRowFromRowSource
public DataValueDescriptor[] getNextRowFromRowSource() throws StandardException
Description copied from interface:RowSourceGet the next row as an array of column objects. The column objects can be a JBMS Storable or any Serializable/Externalizable/Formattable/Streaming type.
A return of null indicates that the complete set of rows has been read.A null column can be specified by leaving the object null, or indicated by returning a non-null getValidColumns. On streaming columns, it can be indicated by returning a non-null get FieldStates.
If RowSource.needToClone() is true then the returned row (the DataValueDescriptor[]) is guaranteed not to be modified by drainer of the RowSource (except that the input stream will be read, of course) and drainer will keep no reference to it before making the subsequent nextRow call. So it is safe to return the same DataValueDescriptor[] in subsequent nextRow calls if that is desirable for performance reasons.
If RowSource.needToClone() is false then the returned row (the DataValueDescriptor[]) may be be modified by drainer of the RowSource, and the drainer may keep a reference to it after making the subsequent nextRow call. In this case the client should severe all references to the row after returning it from getNextRowFromRowSource().
- Throws:
StandardException- on error- See Also:
RowSource.getNextRowFromRowSource()
-
needsToClone
public boolean needsToClone()
Description copied from interface:RowSourceDoes the caller of getNextRowFromRowSource() need to clone the row in order to keep a reference to the row past the getNextRowFromRowSource() call which returned the row. This call must always return the same for all rows in a RowSource (ie. the caller will call this once per scan from a RowSource and assume the behavior is true for all rows in the RowSource).- See Also:
RowSource.needsToClone()
-
closeRowSource
public void closeRowSource()
Description copied from interface:RowSourcecloseRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have. Subsequent call to any method on the RowSource will result in undefined behavior. A closed rowSource can be closed again.- See Also:
RowSource.closeRowSource()
-
needsRowLocation
public boolean needsRowLocation()
Description copied from interface:RowLocationRetRowSourceneedsRowLocation returns true iff this the row source expects the drainer of the row source to call rowLocation after getting a row from getNextRowFromRowSource.- Returns:
- true iff this row source expects some row location to be returned
- See Also:
RowLocationRetRowSource.needsRowLocation()
-
needsRowLocationForDeferredCheckConstraints
public boolean needsRowLocationForDeferredCheckConstraints()
-
rowLocation
public void rowLocation(RowLocation rl) throws StandardException
Description copied from interface:RowLocationRetRowSourcerowLocation is a callback for the drainer of the row source to return the rowLocation of the current row, i.e, the row that is being returned by getNextRowFromRowSource. This interface is for the purpose of loading a base table with index. In that case, the indices can be built at the same time the base table is laid down once the row location of the base row is known. This is an example pseudo code on how this call is expected to be used:boolean needsRL = rowSource.needsRowLocation(); DataValueDescriptor[] row; while((row = rowSource.getNextRowFromRowSource()) != null) { RowLocation rl = heapConglomerate.insertRow(row); if (needsRL) rowSource.rowLocation(rl); }
NeedsRowLocation and rowLocation will ONLY be called by a drainer of the row source which CAN return a row location. Drainer of row source which cannot return rowLocation will guarantee to not call either callbacks. Conversely, if NeedsRowLocation is called and it returns true, then for every row return by getNextRowFromRowSource, a rowLocation callback must also be issued with the row location of the row. Implementor of both the source and the drain of the row source must be aware of this protocol.
The RowLocation object is own by the caller of rowLocation, in other words, the drainer of the RowSource. This is so that we don't need to new a row location for every row. If the Row Source wants to keep the row location, it needs to clone it (RowLocation is a ClonableObject).- Throws:
StandardException- on error- See Also:
RowLocationRetRowSource.rowLocation(org.apache.derby.iapi.types.RowLocation)
-
offendingRowLocation
public void offendingRowLocation(RowLocation rl, long containdId) throws StandardException
- Throws:
StandardException
-
setCurrentRow
public final void setCurrentRow(ExecRow row)
Set the current row to the row passed in.- Parameters:
row- the new current row
-
clearCurrentRow
public void clearCurrentRow()
Clear the current row
-
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 interfaceNoPutResultSet- Returns:
- Whether or not the result set is for update.
-
printQualifiers
public static java.lang.String printQualifiers(Qualifier[][] qualifiers)
Return a 2-d array of Qualifiers as a String
-
updateRow
public void updateRow(ExecRow row, RowChanger rowChanger) throws StandardException
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.- 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:
This method is result sets used for scroll insensitive updatable result sets for other result set it is a no-op.
-
markRowAsDeleted
public void markRowAsDeleted() throws StandardExceptionDescription 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.- Throws:
StandardException- thrown on failure.- See Also:
This method is result sets used for scroll insensitive updatable result sets for other result set it is a no-op.
-
positionScanAtRowLocation
public void positionScanAtRowLocation(RowLocation rl) throws StandardException
Description copied from interface:NoPutResultSetPositions the cursor in the specified rowLocation. Used for scrollable insensitive result sets in order to position the cursor back to a row that has already be visited.- Parameters:
rl- row location of the current cursor row- Throws:
StandardException- thrown on failure to get location from storage engine- See Also:
This method is result sets used for scroll insensitive updatable result sets for other result set it is a no-op.
-
getActivation
public final Activation getActivation()
- Specified by:
getActivationin interfaceResultSet
-
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 interfaceNoPutResultSet
-
getScanIsolationLevel
public int getScanIsolationLevel()
Description copied from interface:NoPutResultSetReturn 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 interfaceNoPutResultSet- Returns:
- The isolation level of the scan (in TransactionController constants).
- See Also:
NoPutResultSet.getScanIsolationLevel()
-
getEstimatedRowCount
public double getEstimatedRowCount()
Description copied from interface:NoPutResultSetGet the estimated row count from this result set.- Specified by:
getEstimatedRowCountin interfaceNoPutResultSet- Returns:
- The estimated row count (as a double) from this result set.
- See Also:
NoPutResultSet.getEstimatedRowCount()
-
requiresRelocking
public boolean requiresRelocking()
Description copied from interface:NoPutResultSetDo we need to relock the row when going to the heap.- Specified by:
requiresRelockingin interfaceNoPutResultSet- Returns:
- Whether or not we need to relock the row when going to the heap.
- See Also:
NoPutResultSet.requiresRelocking()
-
open
public final void open() throws StandardExceptionopen 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 interfaceResultSet- Throws:
StandardException- thrown if cursor finished.
-
getAbsoluteRow
public ExecRow getAbsoluteRow(int row) throws 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 interfaceResultSet- Parameters:
row- The position.- Returns:
- The row at the absolute position, or NULL if no such position.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
getRelativeRow
public ExecRow getRelativeRow(int row) throws 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 interfaceResultSet- Parameters:
row- The position.- Returns:
- The row at the relative position, or NULL if no such position.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
setBeforeFirstRow
public ExecRow setBeforeFirstRow() throws StandardException
Sets the current position to before the first row and returns NULL because there is no current row.- Specified by:
setBeforeFirstRowin interfaceResultSet- Returns:
- NULL.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
checkRowPosition
public boolean checkRowPosition(int isType) throws StandardExceptionDetermine if the cursor is before the first row in the result set.- Specified by:
checkRowPositionin interfaceResultSet- Returns:
- true if before the first row, false otherwise. Returns false when the result set contains no rows.
- Throws:
StandardException- Thrown on error.
-
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 interfaceResultSet- Returns:
- the row number, or 0 if not on a row
-
getFirstRow
public ExecRow getFirstRow() throws StandardException
Returns the first row from the query, and returns NULL when there are no rows.- Specified by:
getFirstRowin interfaceResultSet- Returns:
- The first row, or NULL if no rows.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
getNextRow
public final ExecRow getNextRow() throws 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 interfaceResultSet- Returns:
- the next row in the result
- Throws:
StandardException- thrown on failure.StandardException- ResultSetNotOpen thrown if not yet open.- See Also:
Row
-
getPreviousRow
public ExecRow getPreviousRow() throws StandardException
Returns the previous row from the query, and returns NULL when there are no more previous rows.- Specified by:
getPreviousRowin interfaceResultSet- Returns:
- The previous row, or NULL if no more previous rows.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
getLastRow
public ExecRow getLastRow() throws StandardException
Returns the last row from the query, and returns NULL when there are no rows.- Specified by:
getLastRowin interfaceResultSet- Returns:
- The last row, or NULL if no rows.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
setAfterLastRow
public ExecRow setAfterLastRow() throws StandardException
Sets the current position to after the last row and returns NULL because there is no current row.- Specified by:
setAfterLastRowin interfaceResultSet- Returns:
- NULL.
- Throws:
StandardException- Thrown on failure- See Also:
Row
-
returnsRows
public boolean returnsRows()
Returns true.- Specified by:
returnsRowsin interfaceResultSet- Returns:
- TRUE if the statement returns rows, FALSE if not.
-
modifiedRowCount
public final long modifiedRowCount()
Description copied from interface:ResultSetReturns 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 interfaceResultSet- Returns:
- The number of rows affect by the statement, so far.
-
cleanUp
public void cleanUp() throws StandardExceptionClean up on error- Specified by:
cleanUpin interfaceResultSet- Throws:
StandardException- Thrown on failure
-
isClosed
public boolean isClosed()
Report if closed.
-
finish
public void finish() throws StandardExceptionDescription 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- Throws:
StandardException- on error
-
getExecuteTime
public long getExecuteTime()
Get the execution time in milliseconds.- Specified by:
getExecuteTimein interfaceResultSet- Returns:
- long The execution time in milliseconds.
-
getBeginExecutionTimestamp
public java.sql.Timestamp getBeginExecutionTimestamp()
Get the Timestamp for the beginning of execution.- Specified by:
getBeginExecutionTimestampin interfaceResultSet- Returns:
- Timestamp The Timestamp for the beginning of execution.
-
getEndExecutionTimestamp
public java.sql.Timestamp getEndExecutionTimestamp()
Get the Timestamp for the end of execution.- Specified by:
getEndExecutionTimestampin interfaceResultSet- Returns:
- Timestamp The Timestamp for the end of execution.
-
getSubqueryTrackingArray
public final NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
Description copied from interface:ResultSetGet the subquery ResultSet tracking array from the top ResultSet. (Used for tracking open subqueries when closing down on an error.)- Specified by:
getSubqueryTrackingArrayin interfaceResultSet- Parameters:
numSubqueries- The size of the array (For allocation on demand.)- Returns:
- NoPutResultSet[] Array of NoPutResultSets for subqueries.
- See Also:
ResultSet.getSubqueryTrackingArray(int)
-
getAutoGeneratedKeysResultset
public ResultSet getAutoGeneratedKeysResultset()
Description copied from interface:ResultSetResultSet for rows inserted into the table (contains auto-generated keys columns only)- Specified by:
getAutoGeneratedKeysResultsetin interfaceResultSet- Returns:
- NoPutResultSet NoPutResultSets for rows inserted into the table.
- See Also:
ResultSet.getAutoGeneratedKeysResultset()
-
checkCancellationFlag
public void checkCancellationFlag() throws StandardExceptionChecks whether the currently executing statement has been cancelled. This is done by checking the statement's allocated StatementContext object.- Throws:
StandardException- See Also:
StatementContext
-
addWarning
public final void addWarning(java.sql.SQLWarning w)
Description copied from interface:ResultSetAdd a warning to this result set.- Specified by:
addWarningin interfaceResultSet- Parameters:
w- the warning to add
-
getWarnings
public final java.sql.SQLWarning getWarnings()
Description copied from interface:ResultSetReturn the set of warnings generated during the execution of this result set. The warnings are cleared once this call returns.- Specified by:
getWarningsin interfaceResultSet
-
toXML
public org.w3c.dom.Element toXML(org.w3c.dom.Element parentNode, java.lang.String tag) throws java.lang.ExceptionDescription copied from interface:ResultSetProduce an xml image of this ResultSet and its descendant ResultSets. Appends an element to the parentNode and returns the appended element.
-
toXML
public static org.w3c.dom.Element toXML(org.w3c.dom.Element parentNode, java.lang.String childTag, ResultSet rs) throws java.lang.ExceptionPretty-print a ResultSet as an xml child of a parent node. Return the node representing the ResultSet child.
- Throws:
java.lang.Exception
-
childrenToXML
public static org.w3c.dom.Element childrenToXML(org.w3c.dom.Element outerNode, ResultSet outerRS) throws java.lang.ExceptionPretty-print the inner ResultSet fields inside an outer ResultSet. Returns the outerNode.
- Throws:
java.lang.Exception
-
-
DataMelt 3.0 © DataMelt by jWork.ORG