KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jimm > datavision > source > sql > SQLColumn


1 package jimm.datavision.source.sql;
2 import jimm.datavision.source.Table;
3 import jimm.datavision.source.Column;
4 import java.sql.*;
5
6 /**
7  * A database column. It knows the table to which it belongs, its name,
8  * and other metadata. The id of a column is a string of the form
9  * "table_name.column_name".
10  *
11  * @author Jim Menard, <a HREF="mailto:jimm@io.com">jimm@io.com</a>
12  */

13 public class SQLColumn extends Column {
14
15 protected SQLTable table;
16
17 /**
18  * Constructor.
19  *
20  * @param table the table to which this column belongs
21  * @param colName the column name
22  * @param type the data types
23  * @see java.sql.DatabaseMetaData#getColumns
24  */

25 public SQLColumn(SQLTable table, String JavaDoc colName, int type)
26     throws SQLException
27 {
28     super(table.getName() + "." + colName, colName, type);
29     this.table = table;
30 }
31
32 /**
33  * Returns the table to which this column belongs.
34  *
35  * @return the table
36  */

37 public Table getTable() { return table; }
38
39 }
40
Popular Tags