Top Description Methods
org.apache.derby.vti

public Interface Pushable

Imports
java.sql.SQLException

Support for pushing SQL statement information down into a virtual table. A read-write virtual tables (one that implements java.sql.PreparedStatement) implements this interface to support pushing information into the VTI.
Read-only VTIs (those that implement java.sql.ResultSet) do not support the Pushable interface.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

a boolean value
pushProjection
(VTIEnvironment
The VTI context
vtiEnvironment
,
int[]
Columns being projected out
projectedColumns
)

Indicates the columns that must be returned by a read-write VTI's ResultSet.

Method Detail

pushProjectionback to summary
public boolean pushProjection(VTIEnvironment vtiEnvironment, int[] projectedColumns) throws SQLException

Indicates the columns that must be returned by a read-write VTI's ResultSet. This method is called only during the runtime execution of the VTI, after it has been constructed and before the executeQuery() method is called. At compile time the VTI needs to describe the complete set of columns it can return.
The column identifiers contained in projectedColumns map to the columns described by the VTI's PreparedStatement's ResultSetMetaData. The ResultSet returned by PreparedStatement.executeQuery() must contain these columns in the order given. Column 1 in this ResultSet maps the the column of the VTI identified by projectedColumns[0], column 2 maps to projectedColumns[1] etc.
Any additional columns contained in the ResultSet are ignored by the database engine. The ResultSetMetaData returned by ResultSet.getMetaData() must match the ResultSet.

PreparedStatement's ResultSetMetaData column list {"id", "desc", "price", "tax", "brand"}
projectedColumns = { 2, 3, 5}
results in a ResultSet containing at least these 3 columns {"desc", "price", "brand"} The JDBC column numbering scheme (1 based) ise used for projectedColumns.

Parameters
vtiEnvironment:VTIEnvironment

The VTI context

projectedColumns:int[]

Columns being projected out

Returns:boolean

a boolean value

Exceptions
SQLException:
Error processing the request.