KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > tool > hbm2ddl > ColumnMetadata


1 //$Id: ColumnMetadata.java,v 1.2 2004/08/13 08:05:47 oneovthafew Exp $
2
package org.hibernate.tool.hbm2ddl;
3
4 import java.sql.ResultSet JavaDoc;
5 import java.sql.SQLException JavaDoc;
6
7 /**
8  * JDBC column metadata
9  * @author Christoph Sturm
10  */

11 public class ColumnMetadata {
12     private final String JavaDoc name;
13     private final String JavaDoc typeName;
14     private final int columnSize;
15     private final int decimalDigits;
16     private final String JavaDoc isNullable;
17
18     ColumnMetadata(ResultSet JavaDoc rs) throws SQLException JavaDoc {
19         name = rs.getString("COLUMN_NAME");
20         typeName = rs.getString("TYPE_NAME");
21         columnSize = rs.getInt("COLUMN_SIZE");
22         decimalDigits = rs.getInt("DECIMAL_DIGITS");
23         isNullable = rs.getString("IS_NULLABLE");
24     }
25
26     public String JavaDoc getName() {
27         return name;
28     }
29
30     public String JavaDoc getTypeName() {
31         return typeName;
32     }
33
34     public int getColumnSize() {
35         return columnSize;
36     }
37
38     public int getDecimalDigits() {
39         return decimalDigits;
40     }
41
42     public String JavaDoc getNullable() {
43         return isNullable;
44     }
45
46     public String JavaDoc toString() {
47         return "ColumnMetadata(" + name + ')';
48     }
49
50 }
51
52
53
54
55
56
57
Popular Tags