01: /*
02:
03: Derby - Class org.apache.derby.vti.Pushable
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.vti;
23:
24: import java.sql.SQLException;
25:
26: /**
27: Support for pushing SQL statement information
28: down into a virtual table.
29:
30: A read-write virtual tables (one that implements java.sql.PreparedStatement)
31: implements this interface to support pushing information into the VTI.
32:
33: <BR>
34: Read-only VTIs (those that implement java.sql.ResultSet) do not support the Pushable interface.
35: */
36: public interface Pushable {
37:
38: /**
39: Indicates the columns that must be returned by a read-write VTI's ResultSet.
40: This method is called only during the runtime execution of the VTI, after it has been
41: constructed and before the executeQuery() method is called.
42: At compile time the VTI needs to describe the complete set of columns it can return.
43: <BR>
44: The column identifiers contained in projectedColumns
45: map to the columns described by the VTI's PreparedStatement's
46: ResultSetMetaData. The ResultSet returned by
47: PreparedStatement.executeQuery() must contain
48: these columns in the order given. Column 1 in this
49: ResultSet maps the the column of the VTI identified
50: by projectedColumns[0], column 2 maps to projectedColumns[1] etc.
51: <BR>
52: Any additional columns contained in the ResultSet are ignored
53: by the database engine. The ResultSetMetaData returned by
54: ResultSet.getMetaData() must match the ResultSet.
55: <P>
56: PreparedStatement's ResultSetMetaData column list {"id", "desc", "price", "tax", "brand"}
57: <BR>
58: projectedColumns = { 2, 3, 5}
59: <BR>
60: results in a ResultSet containing at least these 3 columns
61: {"desc", "price", "brand"}
62:
63:
64: The JDBC column numbering scheme (1 based) ise used for projectedColumns.
65:
66:
67: @exception SQLException Error processing the request.
68: */
69: public boolean pushProjection(VTIEnvironment vtiEnvironment,
70: int[] projectedColumns) throws SQLException;
71:
72: }
|