@@ -169,11 +169,11 @@ public Object getArray(long index, int count, Map map) throws SQLException {
169
169
}
170
170
171
171
public int getBaseType ()throws SQLException {
172
- return conn .getSQLType (getBaseTypeName ());
172
+ return Field .getSQLType (getBaseTypeName () );
173
173
}
174
174
175
175
public String getBaseTypeName ()throws SQLException {
176
- String fType =field .getPGType ();
176
+ String fType =field .getTypeName ();
177
177
if (fType .charAt (0 ) =='_' )
178
178
fType =fType .substring (1 );
179
179
return fType ;
@@ -195,24 +195,24 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
195
195
Object array =getArray (index ,count ,map );
196
196
Vector rows =new Vector ();
197
197
Field []fields =new Field [2 ];
198
- fields [0 ] =new Field (conn ,"INDEX" ,conn .getOID ("int2" ),2 );
198
+ fields [0 ] =new Field (conn ,"INDEX" ,field .getOID ("int2" ),2 );
199
199
switch (getBaseType () )
200
200
{
201
201
case Types .BIT :
202
202
boolean []booleanArray = (boolean [])array ;
203
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("bool" ),1 );
203
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("bool" ),1 );
204
204
for (int i =0 ;i <booleanArray .length ;i ++ ) {
205
205
byte [][]tuple =new byte [2 ][0 ];
206
206
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
207
207
tuple [1 ] =conn .getEncoding ().encode ( (booleanArray [i ]?"YES" :"NO" ) );// Value
208
208
rows .addElement (tuple );
209
209
}
210
210
case Types .SMALLINT :
211
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("int2" ),2 );
211
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("int2" ),2 );
212
212
case Types .INTEGER :
213
213
int []intArray = (int [])array ;
214
214
if (fields [1 ] ==null )
215
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("int4" ),4 );
215
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("int4" ),4 );
216
216
for (int i =0 ;i <intArray .length ;i ++ ) {
217
217
byte [][]tuple =new byte [2 ][0 ];
218
218
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -222,7 +222,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
222
222
break ;
223
223
case Types .BIGINT :
224
224
long []longArray = (long [])array ;
225
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("int8" ),8 );
225
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("int8" ),8 );
226
226
for (int i =0 ;i <longArray .length ;i ++ ) {
227
227
byte [][]tuple =new byte [2 ][0 ];
228
228
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -232,7 +232,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
232
232
break ;
233
233
case Types .NUMERIC :
234
234
BigDecimal []bdArray = (BigDecimal [])array ;
235
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("numeric" ), -1 );
235
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("numeric" ), -1 );
236
236
for (int i =0 ;i <bdArray .length ;i ++ ) {
237
237
byte [][]tuple =new byte [2 ][0 ];
238
238
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -242,7 +242,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
242
242
break ;
243
243
case Types .REAL :
244
244
float []floatArray = (float [])array ;
245
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("float4" ),4 );
245
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("float4" ),4 );
246
246
for (int i =0 ;i <floatArray .length ;i ++ ) {
247
247
byte [][]tuple =new byte [2 ][0 ];
248
248
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -252,7 +252,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
252
252
break ;
253
253
case Types .DOUBLE :
254
254
double []doubleArray = (double [])array ;
255
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("float8" ),8 );
255
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("float8" ),8 );
256
256
for (int i =0 ;i <doubleArray .length ;i ++ ) {
257
257
byte [][]tuple =new byte [2 ][0 ];
258
258
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -261,11 +261,11 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
261
261
}
262
262
break ;
263
263
case Types .CHAR :
264
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("char" ),1 );
264
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("char" ),1 );
265
265
case Types .VARCHAR :
266
266
String []strArray = (String [])array ;
267
267
if (fields [1 ] ==null )
268
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("varchar" ), -1 );
268
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("varchar" ), -1 );
269
269
for (int i =0 ;i <strArray .length ;i ++ ) {
270
270
byte [][]tuple =new byte [2 ][0 ];
271
271
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -275,7 +275,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
275
275
break ;
276
276
case Types .DATE :
277
277
java .sql .Date []dateArray = (java .sql .Date [])array ;
278
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("date" ),4 );
278
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("date" ),4 );
279
279
for (int i =0 ;i <dateArray .length ;i ++ ) {
280
280
byte [][]tuple =new byte [2 ][0 ];
281
281
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -285,7 +285,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
285
285
break ;
286
286
case Types .TIME :
287
287
java .sql .Time []timeArray = (java .sql .Time [])array ;
288
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("time" ),8 );
288
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("time" ),8 );
289
289
for (int i =0 ;i <timeArray .length ;i ++ ) {
290
290
byte [][]tuple =new byte [2 ][0 ];
291
291
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index
@@ -295,7 +295,7 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
295
295
break ;
296
296
case Types .TIMESTAMP :
297
297
java .sql .Timestamp []timestampArray = (java .sql .Timestamp [])array ;
298
- fields [1 ] =new Field (conn ,"VALUE" ,conn .getOID ("timestamp" ),8 );
298
+ fields [1 ] =new Field (conn ,"VALUE" ,field .getOID ("timestamp" ),8 );
299
299
for (int i =0 ;i <timestampArray .length ;i ++ ) {
300
300
byte [][]tuple =new byte [2 ][0 ];
301
301
tuple [0 ] =conn .getEncoding ().encode (Integer .toString ((int )index +i ) );// Index