Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class CurrentOfResultSet

extends NoPutResultSetImpl
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Imports
org.apache.derby.iapi.sql.execute.CursorResultSet, .CursorActivation, .ExecRow, .NoPutResultSet, .RowChanger, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.types.RowLocation, org.apache.derby.shared.common.sanity.SanityManager

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.

Field Summary

Modifier and TypeField and Description
private CursorResultSet
private final String
private boolean
private RowLocation
private ExecRow
private CursorResultSet
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
checkNullColsclonedExecRowcncLenresultSetNumbertargetResultSet

Constructor Summary

AccessConstructor and Description
pack-priv
CurrentOfResultSet(String cursorName, Activation activation, int resultSetNumber)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

public void
finish()

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finish.

Implements org.apache.derby.iapi.sql.ResultSet.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().

public ExecRow

Returns:

the last row returned by getNextRow.
getCurrentRow
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Returns the current row of the result set.

private void
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.

public ExecRow
public RowLocation

Returns:

the row location of the current row.
getRowLocation
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

This result set has its row location from the last fetch done.

private ExecRow

Returns:

a sparse heap row with referenced columns
getSparseRow
(ExecRow
compact referenced index row
row
,
int[]
base column positions of index keys, signed with asc/desc info
indexCols
)

Return a sparse heap row, based on a compact index row.

public long

Returns:

long The total amount of time spent (in milliseconds).
getTimeSpent
(int
CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
type
)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

public void
markRowAsDeleted()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.markRowAsDeleted.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Marks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.

public void
public void
updateRow(ExecRow
new values for the currentRow
row
,
RowChanger
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.
rowChanger
)

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.updateRow.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

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.

Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
clearCurrentRowclearOrderableCachecloseRowSourcegetCursorNamegetNextRowFromRowSourcegetResultDescriptiongetValidColumnsisForUpdateneedsRowLocationneedsRowLocationForDeferredCheckConstraintsneedsToCloneoffendingRowLocationpositionScanAtRowLocationprintQualifiersresultSetNumberrowLocationsetCurrentRowsetHasDeferrableCheckssetNeedsRowLocationsetTargetResultSetskipRowskipScanunpackHashValue

Field Detail

cursorback to summary
private CursorResultSet cursor
cursorNameback to summary
private final String cursorName
nextback to summary
private boolean next
rowLocationback to summary
private RowLocation rowLocation
sparseRowback to summary
private ExecRow sparseRow
targetback to summary
private CursorResultSet target

Constructor Detail

CurrentOfResultSetback to summary
pack-priv CurrentOfResultSet(String cursorName, Activation activation, int resultSetNumber)

Method Detail

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

Exceptions
StandardException:
thrown on error
finishback to summary
public void finish() throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finish.

Implements org.apache.derby.iapi.sql.ResultSet.finish.

Doc from org.apache.derby.iapi.sql.ResultSet.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(). Will close the result set if it is not already closed.

Exceptions
StandardException:
on error
getCurrentRowback to summary
public ExecRow getCurrentRow()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Doc from org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Returns 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.

Returns:ExecRow

the last row returned by getNextRow.

See Also
CursorResultSet
getCursorback to summary
private void getCursor() throws StandardException

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.

getNextRowCoreback to summary
public ExecRow getNextRowCore() throws StandardException

Implements abstract org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

If open and not returned yet, returns the row.

Returns:ExecRow

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

the next row in the result

Exceptions
StandardException:
thrown on failure.
getRowLocationback to summary
public RowLocation getRowLocation()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

This result set has its row location from the last fetch done. If it is closed, a null is returned.

Returns:RowLocation

the row location of the current row.

Exceptions
StandardException:
thrown on failure to get row location
See Also
CursorResultSet
getSparseRowback to summary
private ExecRow getSparseRow(ExecRow row, int[] indexCols) throws StandardException

Return a sparse heap row, based on a compact index row.

Parameters
row:ExecRow

compact referenced index row

indexCols:int[]

base column positions of index keys, signed with asc/desc info

Returns:ExecRow

a sparse heap row with referenced columns

getTimeSpentback to summary
public long getTimeSpent(int type)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

Parameters
type:int

CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.

Returns:long

long The total amount of time spent (in milliseconds).

markRowAsDeletedback to summary
public void markRowAsDeleted() throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.markRowAsDeleted.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Marks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.

Exceptions
StandardException:
thrown on failure.
See Also
NoPutResultSet#markRowAsDeleted
openCoreback to summary
public void openCore() throws StandardException

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.openCore.

open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown on failure to open
updateRowback to summary
public void updateRow(ExecRow row, RowChanger rowChanger) throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.updateRow.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

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.

Parameters
row:ExecRow

new values for the currentRow

rowChanger:RowChanger

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.

Exceptions
StandardException:
thrown on failure.
See Also
NoPutResultSet#updateRow