00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.driver;
00026
00027 import java.io.Serializable;
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 public class Field implements Serializable
00042 {
00043 private int scale;
00044 private int precision;
00045 private boolean isSigned;
00046 private boolean isSearchable;
00047 private boolean isDefinitelyWritable;
00048 private boolean isWritable;
00049 private boolean isReadOnly;
00050 private int isNullable;
00051 private boolean isCurrency;
00052 private boolean isCaseSensitive;
00053 private boolean isAutoIncrement;
00054 private String tableName;
00055 private String fieldName;
00056 private int columnDisplaySize;
00057 private int sqlType;
00058 private String typeName;
00059 private String columnClassName;
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 public Field(String table, String name, int columnDisplaySize, int sqlType,
00072 String typeName, String columnClassName)
00073 {
00074 this(table, name, columnDisplaySize, sqlType, typeName, columnClassName,
00075 false, true, false, ResultSetMetaData.columnNullable, true, false,
00076 false, false, false, 0, 0);
00077 }
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 public Field(String table, String name, int columnDisplaySize, int sqlType,
00101 String typeName, String columnClassName, boolean isAutoIncrement,
00102 boolean isCaseSensitive, boolean isCurrency, int isNullable,
00103 boolean isReadOnly, boolean isWritable, boolean isDefinitelyWritable,
00104 boolean isSearchable, boolean isSigned, int precision, int scale)
00105 {
00106 if (table == null)
00107 tableName = null;
00108 else
00109 tableName = new String(table);
00110 fieldName = new String(name);
00111 this.columnDisplaySize = columnDisplaySize;
00112 this.sqlType = sqlType;
00113 this.typeName = typeName;
00114 this.columnClassName = columnClassName;
00115 this.isAutoIncrement = isAutoIncrement;
00116 this.isCaseSensitive = isCaseSensitive;
00117 this.isCurrency = isCurrency;
00118 this.isNullable = isNullable;
00119 this.isReadOnly = isReadOnly;
00120 this.isWritable = isWritable;
00121 this.isDefinitelyWritable = isDefinitelyWritable;
00122 this.isSearchable = isSearchable;
00123 this.isSigned = isSigned;
00124 this.precision = precision;
00125 this.scale = scale;
00126 }
00127
00128
00129
00130
00131
00132
00133 public String getTableName()
00134 {
00135 return tableName;
00136 }
00137
00138
00139
00140
00141
00142
00143
00144 public String getFieldName()
00145 {
00146 return fieldName;
00147 }
00148
00149
00150
00151
00152
00153
00154 public String getFullName()
00155 {
00156 return tableName + "." + fieldName;
00157 }
00158
00159
00160
00161
00162
00163
00164
00165 public void setFieldName(String name)
00166 {
00167 fieldName = name;
00168 }
00169
00170
00171
00172
00173
00174
00175
00176 public String toString()
00177 {
00178 return getFullName();
00179 }
00180
00181
00182
00183
00184
00185
00186
00187 public int getSqlType()
00188 {
00189 return sqlType;
00190 }
00191
00192
00193
00194
00195
00196
00197 public String getTypeName()
00198 {
00199 return typeName;
00200 }
00201
00202
00203
00204
00205 public String getColumnClassName()
00206 {
00207 return columnClassName;
00208 }
00209
00210
00211
00212
00213 public int getColumnDisplaySize()
00214 {
00215 return columnDisplaySize;
00216 }
00217
00218
00219
00220
00221 public boolean isAutoIncrement()
00222 {
00223 return isAutoIncrement;
00224 }
00225
00226
00227
00228
00229 public boolean isCaseSensitive()
00230 {
00231 return isCaseSensitive;
00232 }
00233
00234
00235
00236
00237 public boolean isCurrency()
00238 {
00239 return isCurrency;
00240 }
00241
00242
00243
00244
00245 public boolean isDefinitelyWritable()
00246 {
00247 return isDefinitelyWritable;
00248 }
00249
00250
00251
00252
00253 public int isNullable()
00254 {
00255 return isNullable;
00256 }
00257
00258
00259
00260
00261 public boolean isReadOnly()
00262 {
00263 return isReadOnly;
00264 }
00265
00266
00267
00268
00269 public boolean isWritable()
00270 {
00271 return isWritable;
00272 }
00273
00274
00275
00276
00277 public boolean isSearchable()
00278 {
00279 return isSearchable;
00280 }
00281
00282
00283
00284
00285 public boolean isSigned()
00286 {
00287 return isSigned;
00288 }
00289
00290
00291
00292
00293 public int getPrecision()
00294 {
00295 return precision;
00296 }
00297
00298
00299
00300
00301 public int getScale()
00302 {
00303 return scale;
00304 }
00305
00306 }