KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > vti > Pushable


1 /*
2
3    Derby - Class org.apache.derby.vti.Pushable
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (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 JavaDoc;
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     /**
40         Indicates the columns that must be returned by a read-write VTI's ResultSet.
41         This method is called only during the runtime execution of the VTI, after it has been
42         constructed and before the executeQuery() method is called.
43         At compile time the VTI needs to describe the complete set of columns it can return.
44         <BR>
45         The column identifiers contained in projectedColumns
46         map to the columns described by the VTI's PreparedStatement's
47         ResultSetMetaData. The ResultSet returned by
48         PreparedStatement.executeQuery() must contain
49         these columns in the order given. Column 1 in this
50         ResultSet maps the the column of the VTI identified
51         by projectedColumns[0], column 2 maps to projectedColumns[1] etc.
52         <BR>
53         Any additional columns contained in the ResultSet are ignored
54         by the database engine. The ResultSetMetaData returned by
55         ResultSet.getMetaData() must match the ResultSet.
56         <P>
57         PreparedStatement's ResultSetMetaData column list {"id", "desc", "price", "tax", "brand"}
58         <BR>
59         projectedColumns = { 2, 3, 5}
60         <BR>
61         results in a ResultSet containing at least these 3 columns
62         {"desc", "price", "brand"}
63
64
65         The JDBC column numbering scheme (1 based) ise used for projectedColumns.
66
67
68         @exception SQLException Error processing the request.
69     */

70     public boolean pushProjection(VTIEnvironment vtiEnvironment, int[] projectedColumns)
71         throws SQLException JavaDoc;
72
73 }
74
Popular Tags