KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > ResultColumnDescriptor


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.ResultColumnDescriptor
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.iapi.sql;
23
24 import org.apache.derby.iapi.types.DataTypeDescriptor;
25
26 /**
27  * A ResultColumnDescriptor describes a result column in a ResultSet.
28  *
29  * @author Jeff Lichtman
30  */

31
32 public interface ResultColumnDescriptor
33 {
34     /**
35      * Returns a DataTypeDescriptor for the column. This DataTypeDescriptor
36      * will not represent an actual value, it will only represent the type
37      * that all values in the column will have.
38      *
39      * @return A DataTypeDescriptor describing the type of the column.
40      */

41     DataTypeDescriptor getType();
42
43     /**
44      * Returns the name of the Column.
45      *
46      * @return A String containing the name of the column.
47      */

48     String JavaDoc getName();
49
50     /**
51      * Get the name of the schema for the Column's base table, if any.
52      * Following example queries will all return APP (assuming user is in schema APP)
53      * select t.a from t
54      * select b.a from t as b
55      * select app.t.a from t
56      *
57      * @return The name of the schema of the Column's base table. If the column
58      * is not in a schema (i.e. is a derived column), it returns NULL.
59      */

60     String JavaDoc getSourceSchemaName();
61
62     /**
63      * Get the name of the underlying(base) table this column comes from, if any.
64      * Following example queries will all return T
65      * select a from t
66      * select b.a from t as b
67      * select t.a from t
68      *
69      * @return A String containing the name of the base table of the Column
70      * is in. If the column is not in a table (i.e. is a
71      * derived column), it returns NULL.
72      * @return The name of the Column's base table. If the column
73      * is not in a schema (i.e. is a derived column), it returns NULL.
74      */

75     String JavaDoc getSourceTableName();
76
77     /**
78      * Return true if the column is wirtable by a positioned update.
79      *
80      * @return TRUE, if the column is a base column of a table and is
81      * writable by a positioned update.
82      */

83     boolean updatableByCursor();
84
85     /**
86      * Get the position of the Column.
87      * NOTE - position is 1-based.
88      *
89      * @return An int containing the position of the Column
90      * within the table.
91      */

92     int getColumnPosition();
93
94     /**
95      * Tell us if the column is an autoincrement column or not.
96      *
97      * @return TRUE, if the column is a base column of a table and is an
98      * autoincrement column.
99      */

100     boolean isAutoincrement();
101
102     /*
103      * NOTE: These interfaces are intended to support JDBC. There are some
104      * JDBC methods on java.sql.ResultSetMetaData that have no equivalent
105      * here, mainly because they are of questionable use to us. They are:
106      * getCatalogName() (will we support catalogs?), getColumnLabel(),
107      * isCaseSensitive(), isCurrency(),
108      * isDefinitelyWritable(), isReadOnly(), isSearchable(), isSigned(),
109      * isWritable()). The JDBC driver implements these itself, using
110      * the data type information and knowing data type characteristics.
111      */

112 }
113
Popular Tags