Top Description Fields Methods
org.apache.derby.vti

public Interface IFastPath

Imports
org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.shared.common.error.StandardException, java.sql.ResultSet, .SQLException

An internal api for VTIs to allow VTI's written in terms of the datatype system, e.g. returning rows. This allows passing of data from the VTI into the query engine without a conversion through a JDBC ResultSet.

Field Summary

Modifier and TypeField and Description
public static final int
GOT_ROW

Indicates nextRow() found a row..

public static final int
NEED_RS

Indicates nextRow() has completed its scan but executeQuery must be called to complete the query.

public static final int
SCAN_COMPLETED

Indicates nextRow() has completed its scan.

Method Summary

Modifier and TypeMethod and Description
public void
currentRow(ResultSet
A ResultSet
rs
,
DataValueDescriptor[]
The row which was just processed
row
)

A call from the VTI execution layer back into the supplied VTI.

public boolean

Returns:

true if the VTI starts out as a fast path query
executeAsFastPath
()

Start a query.

public int

Returns:

GOT_ROW, SCAN_COMPLETED, or NEED_RS
nextRow
(DataValueDescriptor[]
The next row
row
)

When operating in fast path mode return the next row into the passed in row parameter.

public void
rowsDone()

Called once the ResultSet returned by executeQuery() has emptied all of its rows (next() has returned false).

Field Detail

GOT_ROWback to summary
public static final int GOT_ROW

Indicates nextRow() found a row..

NEED_RSback to summary
public static final int NEED_RS

Indicates nextRow() has completed its scan but executeQuery must be called to complete the query.

SCAN_COMPLETEDback to summary
public static final int SCAN_COMPLETED

Indicates nextRow() has completed its scan.

Method Detail

currentRowback to summary
public void currentRow(ResultSet rs, DataValueDescriptor[] row) throws StandardException, SQLException

A call from the VTI execution layer back into the supplied VTI. Presents the row just processed as an array of DataValueDescriptors. This only called when the VTI is being executed as a regular ResultSet VTI

Parameters
rs:ResultSet

A ResultSet

row:DataValueDescriptor[]

The row which was just processed

Exceptions
StandardException:
on error
SQLException:
on error
executeAsFastPathback to summary
public boolean executeAsFastPath() throws StandardException, SQLException

Start a query. Returns true if the VTI will start out as a fast path query and thus rows will be returned by nextRow(). Returns false if the engine must call the VTI's PreparedStatement.executeQuery() method to execute as a regular ResultSet VTI.

Returns:boolean

true if the VTI starts out as a fast path query

Exceptions
StandardException:
on error
SQLException:
on error
nextRowback to summary
public int nextRow(DataValueDescriptor[] row) throws StandardException, SQLException

When operating in fast path mode return the next row into the passed in row parameter. Returns GOT_ROW if a valid row is found. Returns SCAN_COMPLETED if the scan is complete. Returns NEED_RS if the rest of the query must be handled as a regular ResultSet VTI by the engine calling the VTI's PreparedStatement.executeQuery()

Parameters
row:DataValueDescriptor[]

The next row

Returns:int

GOT_ROW, SCAN_COMPLETED, or NEED_RS

Exceptions
StandardException:
on error
SQLException:
on error
rowsDoneback to summary
public void rowsDone() throws StandardException, SQLException

Called once the ResultSet returned by executeQuery() has emptied all of its rows (next() has returned false).

Exceptions
StandardException:
on error
SQLException:
on error