org.apache.derby.impl.sql.execute
Class DMLWriteResultSet
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.DMLWriteResultSet
-
- All Implemented Interfaces:
- ResultSet
public abstract class DMLWriteResultSet extends java.lang.ObjectFor INSERT/UPDATE/DELETE impls. Used to tag them.
-
-
Field Summary
Fields Modifier and Type Field and Description longrowCount-
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddWarning(java.sql.SQLWarning w)Add a warning to this result set.booleancheckRowPosition(int isType)Determine if the cursor is before the first row in the result set.voidclearCurrentRow()Clear the current row.voidclose(boolean underMerge)Dump the stat if not already done so.booleandoesCommit()Does this ResultSet cause a commit or rollback.voidevaluateGenerationClauses(GeneratedMethod generationClauses, Activation activation, NoPutResultSet source, ExecRow newRow, boolean isUpdate)Compute the generation clauses on the current row in order to fill in computed columns.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 the cursor name, null in this case.java.sql.TimestampgetEndExecutionTimestamp()Get the Timestamp for the end of execution.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()No rows to return, so throw an exception.ExecRowgetPreviousRow()Returns the previous row from the query, and returns NULL when there are no more previous rows.java.lang.StringgetQueryPlanText(int depth)RESOLVE - This method will go away once it is overloaded in all subclasses.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 inserted rows.intgetRowNumber()Returns the row number of the current row.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 ResultSetjava.sql.SQLWarninggetWarnings()Return the set of warnings generated during the execution of this result set.booleanisClosed()Find out if theResultSetis closed.longmodifiedRowCount()Returns zero.voidrememberConstraint(UUID cid)booleanreturnsRows()Returns FALSEExecRowsetAfterLastRow()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.org.w3c.dom.ElementtoXML(org.w3c.dom.Element parentNode, java.lang.String tag)Produce an xml image of this ResultSet and its descendant ResultSets.
-
-
-
Method Detail
-
modifiedRowCount
public final long modifiedRowCount()
Returns zero.- Specified by:
modifiedRowCountin interfaceResultSet- Returns:
- The number of rows affect by the statement, so far.
-
getResultDescription
public ResultDescription getResultDescription()
Returns the description of the inserted rows. REVISIT: Do we want this to return NULL instead?- Specified by:
getResultDescriptionin interfaceResultSet- Returns:
- the description of the inserted rows
-
rememberConstraint
public void rememberConstraint(UUID cid) throws StandardException
- Throws:
StandardException
-
returnsRows
public final boolean returnsRows()
Returns FALSE- Specified by:
returnsRowsin interfaceResultSet- Returns:
- TRUE if the statement returns rows, FALSE if not.
-
getActivation
public final Activation getActivation()
- Specified by:
getActivationin interfaceResultSet
-
getAbsoluteRow
public final 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 final 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 final 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
-
getFirstRow
public final 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
No rows to return, so throw an exception.- Specified by:
getNextRowin interfaceResultSet- Returns:
- The next row, or NULL if no more rows.
- Throws:
StandardException- Always throws a StandardException to indicate that this method is not intended to be used.- See Also:
Row
-
getPreviousRow
public final 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 final 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 final 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
-
clearCurrentRow
public final void 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.- Specified by:
clearCurrentRowin interfaceResultSet
-
checkRowPosition
public final boolean checkRowPosition(int isType)
Determine 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.
-
getRowNumber
public final 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
-
close
public void close(boolean underMerge) throws StandardExceptionDump the stat if not already done so. Close all of the open subqueries.- Parameters:
underMerge- True if this is part of an action of a MERGE statement.- Throws:
StandardException- thrown on error
-
isClosed
public boolean isClosed()
Find out if theResultSetis 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.
-
getQueryPlanText
public java.lang.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- Indentation level.- Returns:
- String The query plan as a String.
-
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).
-
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()
-
getCursorName
public java.lang.String getCursorName()
Return the cursor name, null in this case.- Specified by:
getCursorNamein interfaceResultSet- Returns:
- A String with the name of the cursor, if any. Returns NULL if this is not a cursor statement.
- See Also:
ResultSet.getCursorName()
-
evaluateGenerationClauses
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- the generated method which evaluates generation clausesactivation- the thread-specific instance of the generated classsource- the tuple stream driving this INSERT/UPDATEnewRow- the base row being stuffedisUpdate- true if this is an UPDATE. false otherwise.- Throws:
StandardException
-
doesCommit
public boolean doesCommit()
Does this ResultSet cause a commit or rollback.- Returns:
- Whether or not this ResultSet cause a commit or rollback.
-
addWarning
public 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 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG