Package org.apache.derby.vti
Interface IFastPath
-
public interface IFastPathAn 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
Fields Modifier and Type Field Description static intGOT_ROWIndicates nextRow() found a row..static intNEED_RSIndicates nextRow() has completed its scan but executeQuery must be called to complete the query.static intSCAN_COMPLETEDIndicates nextRow() has completed its scan.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcurrentRow(java.sql.ResultSet rs, DataValueDescriptor[] row)A call from the VTI execution layer back into the supplied VTI.booleanexecuteAsFastPath()Start a query.intnextRow(DataValueDescriptor[] row)When operating in fast path mode return the next row into the passed in row parameter.voidrowsDone()Called once the ResultSet returned by executeQuery() has emptied all of its rows (next() has returned false).
-
-
-
Field Detail
-
SCAN_COMPLETED
static final int SCAN_COMPLETED
Indicates nextRow() has completed its scan.- See Also:
- Constant Field Values
-
GOT_ROW
static final int GOT_ROW
Indicates nextRow() found a row..- See Also:
- Constant Field Values
-
NEED_RS
static final int NEED_RS
Indicates nextRow() has completed its scan but executeQuery must be called to complete the query.- See Also:
- Constant Field Values
-
-
Method Detail
-
executeAsFastPath
boolean executeAsFastPath() throws StandardException, java.sql.SQLExceptionStart 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.- Throws:
StandardExceptionjava.sql.SQLException
-
nextRow
int nextRow(DataValueDescriptor[] row) throws StandardException, java.sql.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()- Throws:
StandardExceptionjava.sql.SQLException
-
currentRow
void currentRow(java.sql.ResultSet rs, DataValueDescriptor[] row) throws StandardException, java.sql.SQLExceptionA 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- Throws:
StandardExceptionjava.sql.SQLException
-
rowsDone
void rowsDone() throws StandardException, java.sql.SQLExceptionCalled once the ResultSet returned by executeQuery() has emptied all of its rows (next() has returned false).- Throws:
StandardExceptionjava.sql.SQLException
-
-