Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql.execute
Class NoRowsResultSetImpl  view NoRowsResultSetImpl download NoRowsResultSetImpl.java

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.NoRowsResultSetImpl
All Implemented Interfaces:
org.apache.derby.iapi.sql.ResultSet
Direct Known Subclasses:
CallStatementResultSet, DMLWriteResultSet, MiscResultSet

abstract class NoRowsResultSetImpl
extends java.lang.Object
implements org.apache.derby.iapi.sql.ResultSet

This implementation of ResultSet is meant to be overridden by subtypes in the execution engine. Its primary users will be DDL, which only need to define a constructor to create the DDL object being defined. All other ResultSet operations will be handled by this superclass -- i.e., nothing is allowed to be done to a DDL Result Set, since it has no rows to provide.

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.


Field Summary
protected  org.apache.derby.iapi.sql.Activation activation
           
protected  long beginExecutionTime
           
protected  long beginTime
           
private  boolean dumpedStats
           
protected  long endExecutionTime
           
protected  long endTime
           
protected  java.lang.String indent
           
private  boolean isClosed
           
private  boolean isTopResultSet
           
protected  org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc
           
protected  int sourceDepth
           
private  boolean statisticsTimingOn
           
protected  java.lang.String subIndent
           
protected  org.apache.derby.iapi.sql.execute.NoPutResultSet[] subqueryTrackingArray
           
 
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
 
Constructor Summary
(package private) NoRowsResultSetImpl(org.apache.derby.iapi.sql.Activation activation)
           
 
Method Summary
 boolean checkRowPosition(int isType)
          Determine if the cursor is before the first row in the result set.
 void close()
          No rows to return, does nothing
 boolean doesCommit()
          Does this ResultSet cause a commit or rollback.
static void evaluateACheckConstraint(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM, java.lang.String checkName, long heapConglom, org.apache.derby.iapi.sql.Activation activation)
          Run a check constraint against the current row.
static void evaluateCheckConstraints(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM, org.apache.derby.iapi.sql.Activation activation)
          Run check constraints against the current row.
 void finish()
          doesn't need to do anything, as no calls are made that need to be restricted once the result set is 'finished'.
 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  long getCurrentTimeMillis()
          Return the current time in milliseconds, if DEBUG and RunTimeStats is on, else return 0.
 java.lang.String getCursorName()
          Return the cursor name, null in this case.
 java.sql.Timestamp getEndExecutionTimestamp()
          Get the Timestamp for the end of execution.
 long getExecuteTime()
          Get the execution time in milliseconds.
 org.apache.derby.iapi.sql.execute.ExecRow getFirstRow()
          Returns the first row from the query, and returns NULL when there are no rows.
 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()
          No rows to return, so throw an exception.
 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.
 java.lang.String getQueryPlanText(int depth)
          RESOLVE - This method will go away once it is overloaded in all subclasses.
 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 null.
 int getRowNumber()
          Returns the row number of the current row.
 org.apache.derby.iapi.sql.execute.NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
          Get the subquery ResultSet tracking array from the top ResultSet.
 long getTimeSpent(int type)
          Return the total amount of time spent in this ResultSet
 java.sql.SQLWarning getWarnings()
          Return the set of warnings generated during the execution of this result set.
 boolean isClosed()
          Just report that it is always closed.
 int modifiedRowCount()
          Returns zero.
 boolean returnsRows()
          Returns FALSE
 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.
 
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.ResultSet
cleanUp, open
 

Field Detail

activation

protected final org.apache.derby.iapi.sql.Activation activation

isTopResultSet

private boolean isTopResultSet

dumpedStats

private boolean dumpedStats

subqueryTrackingArray

protected org.apache.derby.iapi.sql.execute.NoPutResultSet[] subqueryTrackingArray

statisticsTimingOn

private final boolean statisticsTimingOn

isClosed

private boolean isClosed

indent

protected java.lang.String indent

subIndent

protected java.lang.String subIndent

sourceDepth

protected int sourceDepth

lcc

protected final org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc

beginTime

protected long beginTime

endTime

protected long endTime

beginExecutionTime

protected long beginExecutionTime

endExecutionTime

protected long endExecutionTime
Constructor Detail

NoRowsResultSetImpl

NoRowsResultSetImpl(org.apache.derby.iapi.sql.Activation activation)
              throws org.apache.derby.iapi.error.StandardException
Method Detail

returnsRows

public final boolean returnsRows()
Returns FALSE

Specified by:
returnsRows in interface org.apache.derby.iapi.sql.ResultSet

modifiedRowCount

public int modifiedRowCount()
Returns zero.

Specified by:
modifiedRowCount in interface org.apache.derby.iapi.sql.ResultSet

getResultDescription

public org.apache.derby.iapi.sql.ResultDescription getResultDescription()
Returns null.

Specified by:
getResultDescription in interface org.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:
getAbsoluteRow in interface org.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:
getRelativeRow in interface org.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:
setBeforeFirstRow in interface org.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:
getFirstRow in interface org.apache.derby.iapi.sql.ResultSet

getNextRow

public org.apache.derby.iapi.sql.execute.ExecRow getNextRow()
                                                     throws org.apache.derby.iapi.error.StandardException
No rows to return, so throw an exception.

Specified by:
getNextRow in interface org.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:
getPreviousRow in interface org.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:
getLastRow in interface org.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:
setAfterLastRow in interface org.apache.derby.iapi.sql.ResultSet

checkRowPosition

public boolean checkRowPosition(int isType)
Determine if the cursor is before the first row in the result set.

Specified by:
checkRowPosition in interface org.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:
getRowNumber in interface org.apache.derby.iapi.sql.ResultSet

close

public void close()
           throws org.apache.derby.iapi.error.StandardException
No rows to return, does nothing

Specified by:
close in interface org.apache.derby.iapi.sql.ResultSet

isClosed

public boolean isClosed()
Just report that it is always closed. RESOLVE: if we don't report that we are closed, then we will wind up with a dependency problem when we send an invalidateFor on our own Statement. It will call lcc.verifyNoOpenResultSets(), which is really supposed to be verify that there are no read only result sets that are open.

Specified by:
isClosed in interface org.apache.derby.iapi.sql.ResultSet

finish

public void finish()
            throws org.apache.derby.iapi.error.StandardException
doesn't need to do anything, as no calls are made that need to be restricted once the result set is 'finished'.

Specified by:
finish in interface org.apache.derby.iapi.sql.ResultSet

getExecuteTime

public long getExecuteTime()
Get the execution time in milliseconds.

Specified by:
getExecuteTime in interface org.apache.derby.iapi.sql.ResultSet

getBeginExecutionTimestamp

public java.sql.Timestamp getBeginExecutionTimestamp()
Get the Timestamp for the beginning of execution.

Specified by:
getBeginExecutionTimestamp in interface org.apache.derby.iapi.sql.ResultSet

getEndExecutionTimestamp

public java.sql.Timestamp getEndExecutionTimestamp()
Get the Timestamp for the end of execution.

Specified by:
getEndExecutionTimestamp in interface org.apache.derby.iapi.sql.ResultSet

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.


getTimeSpent

public long getTimeSpent(int type)
Return the total amount of time spent in this ResultSet

Specified by:
getTimeSpent in interface org.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:
getSubqueryTrackingArray in interface org.apache.derby.iapi.sql.ResultSet

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:
getAutoGeneratedKeysResultset in interface org.apache.derby.iapi.sql.ResultSet

getCursorName

public java.lang.String getCursorName()
Return the cursor name, null in this case.

Specified by:
getCursorName in interface org.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.)


evaluateACheckConstraint

public static void evaluateACheckConstraint(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM,
                                            java.lang.String checkName,
                                            long heapConglom,
                                            org.apache.derby.iapi.sql.Activation activation)
                                     throws org.apache.derby.iapi.error.StandardException
Run a check constraint against the current row. Raise an error if the check constraint is violated.


evaluateCheckConstraints

public static void evaluateCheckConstraints(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM,
                                            org.apache.derby.iapi.sql.Activation activation)
                                     throws org.apache.derby.iapi.error.StandardException
Run check constraints against the current row. Raise an error if a check constraint is violated.


doesCommit

public boolean doesCommit()
Does this ResultSet cause a commit or rollback.


getWarnings

public 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:
getWarnings in interface org.apache.derby.iapi.sql.ResultSet