Lines 63-68
Link Here
|
63 |
private final MetadataElement parent; |
63 |
private final MetadataElement parent; |
64 |
private final String name; |
64 |
private final String name; |
65 |
private final SQLType type; |
65 |
private final SQLType type; |
|
|
66 |
private final String typeName; |
66 |
private final int length; |
67 |
private final int length; |
67 |
private final int precision; |
68 |
private final int precision; |
68 |
private final short radix; |
69 |
private final short radix; |
Lines 79-91
Link Here
|
79 |
public static JDBCValue createProcedureValue(ResultSet rs, MetadataElement parent) throws SQLException { |
80 |
public static JDBCValue createProcedureValue(ResultSet rs, MetadataElement parent) throws SQLException { |
80 |
String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME")); |
81 |
String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME")); |
81 |
SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE")); |
82 |
SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE")); |
|
|
83 |
String typeName = rs.getString("TYPE_NAME"); |
82 |
int length = rs.getInt("LENGTH"); |
84 |
int length = rs.getInt("LENGTH"); |
83 |
int precision = rs.getInt("PRECISION"); |
85 |
int precision = rs.getInt("PRECISION"); |
84 |
short scale = rs.getShort("SCALE"); |
86 |
short scale = rs.getShort("SCALE"); |
85 |
short radix = rs.getShort("RADIX"); |
87 |
short radix = rs.getShort("RADIX"); |
86 |
Nullable nullable = JDBCUtils.getProcedureNullable(rs.getShort("NULLABLE")); |
88 |
Nullable nullable = JDBCUtils.getProcedureNullable(rs.getShort("NULLABLE")); |
87 |
|
89 |
|
88 |
return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable); |
90 |
return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable); |
89 |
} |
91 |
} |
90 |
|
92 |
|
91 |
/** |
93 |
/** |
Lines 111-116
Link Here
|
111 |
public static JDBCValue createTableColumnValue(ResultSet rs, MetadataElement parent) throws SQLException { |
113 |
public static JDBCValue createTableColumnValue(ResultSet rs, MetadataElement parent) throws SQLException { |
112 |
String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME")); |
114 |
String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME")); |
113 |
SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE")); |
115 |
SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE")); |
|
|
116 |
String typeName = rs.getString("TYPE_NAME"); |
114 |
|
117 |
|
115 |
int length = 0; |
118 |
int length = 0; |
116 |
int precision = 0; |
119 |
int precision = 0; |
Lines 126-132
Link Here
|
126 |
short radix = rs.getShort("NUM_PREC_RADIX"); |
129 |
short radix = rs.getShort("NUM_PREC_RADIX"); |
127 |
Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE")); |
130 |
Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE")); |
128 |
|
131 |
|
129 |
return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable); |
132 |
return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable); |
130 |
} |
133 |
} |
131 |
|
134 |
|
132 |
/** |
135 |
/** |
Lines 140-145
Link Here
|
140 |
public static JDBCValue createTableColumnValueODBC(ResultSet rs, MetadataElement parent) throws SQLException { |
143 |
public static JDBCValue createTableColumnValueODBC(ResultSet rs, MetadataElement parent) throws SQLException { |
141 |
String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME")); |
144 |
String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME")); |
142 |
SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE")); |
145 |
SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE")); |
|
|
146 |
String typeName = rs.getString("TYPE_NAME"); |
143 |
int length = 0; |
147 |
int length = 0; |
144 |
int precision = 0; |
148 |
int precision = 0; |
145 |
if (JDBCUtils.isCharType(type)) { |
149 |
if (JDBCUtils.isCharType(type)) { |
Lines 151-160
Link Here
|
151 |
short radix = rs.getShort("RADIX"); |
155 |
short radix = rs.getShort("RADIX"); |
152 |
Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE")); |
156 |
Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE")); |
153 |
|
157 |
|
154 |
return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable); |
158 |
return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable); |
155 |
} |
159 |
} |
156 |
|
160 |
|
157 |
public JDBCValue(MetadataElement parent, String name, SQLType type, int length, int precision, short radix, short scale, Nullable nullable) { |
161 |
public JDBCValue(MetadataElement parent, String name, SQLType type, |
|
|
162 |
String typeName, int length, int precision, short radix, |
163 |
short scale, Nullable nullable) { |
158 |
this.parent = parent; |
164 |
this.parent = parent; |
159 |
this.name = name; |
165 |
this.name = name; |
160 |
this.type = type; |
166 |
this.type = type; |
Lines 163-168
Link Here
|
163 |
this.radix = radix; |
169 |
this.radix = radix; |
164 |
this.scale = scale; |
170 |
this.scale = scale; |
165 |
this.nullable = nullable; |
171 |
this.nullable = nullable; |
|
|
172 |
this.typeName = typeName; |
166 |
} |
173 |
} |
167 |
|
174 |
|
168 |
@Override |
175 |
@Override |
Lines 201-206
Link Here
|
201 |
} |
208 |
} |
202 |
|
209 |
|
203 |
@Override |
210 |
@Override |
|
|
211 |
public String getTypeName() { |
212 |
return typeName; |
213 |
} |
214 |
|
215 |
@Override |
204 |
public String toString() { |
216 |
public String toString() { |
205 |
return "name=" + name + ", type=" + type + ", length=" + getLength() + ", precision=" + getPrecision() + |
217 |
return "name=" + name + ", type=" + type + ", length=" + getLength() + ", precision=" + getPrecision() + |
206 |
", radix=" + getRadix() + ", scale=" + getScale() + ", nullable=" + nullable; |
218 |
", radix=" + getRadix() + ", scale=" + getScale() + ", nullable=" + nullable; |