Source Code Cross Referenced for ColumnInfo.java in  » Database-Client » DBBrowser » org » dbbrowser » db » engine » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » DBBrowser » org.dbbrowser.db.engine.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.dbbrowser.db.engine.model;
002:
003:        /**
004:         * This class holds information about a DB column
005:         * @author amangat
006:         *
007:         */
008:        public class ColumnInfo {
009:            public static final String COLUMN_NULLABLE = "NULLABLE";
010:            public static final String COLUMN_NOT_NULLABLE = "NOT_NULLABLE";
011:            public static final String COLUMN_NULLABLE_NATURE_UNKNOWN = "UNKNOWN";
012:
013:            public static final String COLUMN_TYPE_VARCHAR = "VARCHAR"; //String
014:            public static final String COLUMN_TYPE_VARCHAR2 = "VARCHAR2"; //String
015:            public static final String COLUMN_TYPE_NUMBER = "NUMBER"; //Integer
016:            public static final String COLUMN_TYPE_BIG_DECIMAL = "BIG_DECIMAL"; //BigDecimal
017:            public static final String COLUMN_TYPE_DATE = "DATE"; //Date
018:            public static final String COLUMN_TYPE_DATE_TIME = "DATETIME"; //Date
019:            public static final String COLUMN_TYPE_TIMESTAMP = "TIMESTAMP"; //Date
020:            public static final String COLUMN_TYPE_BIG_INT = "BIG_INT"; //Long
021:            public static final String COLUMN_TYPE_CHAR = "CHAR"; //String
022:            public static final String COLUMN_TYPE_DECIMAL = "DECIMAL"; //BigDecimal
023:            public static final String COLUMN_TYPE_FLOAT = "FLOAT"; //Float
024:            public static final String COLUMN_TYPE_REAL = "REAL"; //Double
025:            public static final String COLUMN_TYPE_SMALL_INT = "SMALL_INT"; //Integer
026:            public static final String COLUMN_TYPE_TINY_INT = "TINY_INT"; //Integer
027:
028:            private String columnName = null;
029:            private String columnTypeName = null;
030:            private String equivalentJavaClass = null;
031:            private Integer columnDisplaySize = null;
032:            private String nullableNature = null;
033:            private Boolean isAutoIncrement = null;
034:            private Boolean isPrimaryKeyColumn = null;
035:            private Boolean editable = null;
036:            private Integer columnType = null;
037:
038:            /**
039:             * Constructer
040:             * @param columnName
041:             * @param columnTypeName
042:             * @param equivalentJavaClass
043:             * @param columnDisplaySize
044:             * @param nullableNature
045:             * @param isPrimaryKeyColumn
046:             * @param editable
047:             * @param columnType
048:             */
049:            public ColumnInfo(String columnName, String columnTypeName,
050:                    String equivalentJavaClass, Integer columnDisplaySize,
051:                    String nullableNature, Boolean isAutoIncrement,
052:                    Boolean isPrimaryKeyColumn, Boolean editable,
053:                    Integer columnType) {
054:                this .columnName = columnName;
055:                this .columnTypeName = columnTypeName;
056:                this .equivalentJavaClass = equivalentJavaClass;
057:                this .columnDisplaySize = columnDisplaySize;
058:                this .nullableNature = nullableNature;
059:                this .isAutoIncrement = isAutoIncrement;
060:                this .isPrimaryKeyColumn = isPrimaryKeyColumn;
061:                this .editable = editable;
062:                this .columnType = columnType;
063:            }
064:
065:            /**
066:             * Get the column name
067:             * @return
068:             */
069:            public String getColumnName() {
070:                return this .columnName;
071:            }
072:
073:            /**
074:             * Returns the column type name e.g. NUMBER, VARCHAR and DATE.  The types come from java.sql.Types
075:             * @return
076:             */
077:            public String getColumnTypeName() {
078:                return this .columnTypeName;
079:            }
080:
081:            /**
082:             * Get the equivalent java class to represent this column e.g. java.lang.Integer
083:             * @return
084:             */
085:            public String getEquivalentJavaClass() {
086:                return this .equivalentJavaClass;
087:            }
088:
089:            /**
090:             * Returns the display size of the column
091:             * @return
092:             */
093:            public Integer getColumnDisplaySize() {
094:                return this .columnDisplaySize;
095:            }
096:
097:            /**
098:             * Returns a String describing the nullable nature
099:             * <ul>
100:             * 	<li>ColumnInfo.NULLABLE - if the column is nullable</li>
101:             * 	<li>ColumnInfo.NOT_NULLABLE - if the column is not nullable</li>
102:             * 	<li>ColumnInfo.UNKNOWN - if the nature cannot be determined</li>
103:             * </ul>
104:             * @return
105:             */
106:            public String getNullableNature() {
107:                return this .nullableNature;
108:            }
109:
110:            /**
111:             * Returns true if this column is auto incremented
112:             * @return
113:             */
114:            public Boolean isAutoIncrement() {
115:                return this .isAutoIncrement;
116:            }
117:
118:            /**
119:             * Returns true if it is a primary key column
120:             * @return
121:             */
122:            public Boolean isPrimaryKeyColumn() {
123:                return this .isPrimaryKeyColumn;
124:            }
125:
126:            /**
127:             * Returns true if this column is editable
128:             * @return
129:             */
130:            public Boolean isEditable() {
131:                return this .editable;
132:            }
133:
134:            /**
135:             * Returns the column type as defined in the java.sql.Types
136:             * @return
137:             */
138:            public Integer getColumnType() {
139:                return this .columnType;
140:            }
141:
142:            /**
143:             * For debugging only
144:             */
145:            public String toString() {
146:                StringBuffer buffer = new StringBuffer();
147:                buffer.append("Column Info----------------\n");
148:                buffer.append("Column name: " + this .getColumnName() + "\n");
149:                buffer
150:                        .append("Column type: " + this .getColumnTypeName()
151:                                + "\n");
152:                buffer.append("Java class: " + this .getEquivalentJavaClass()
153:                        + "\n");
154:                buffer.append("Is primary key column: "
155:                        + this .isPrimaryKeyColumn() + "\n");
156:                buffer.append("Is editable: " + this .isEditable() + "\n");
157:                buffer.append("Column type: " + this .getColumnType() + "\n");
158:
159:                return buffer.toString();
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.