Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a263e39

Browse files
committed
Re-apply Array.java patch to new Array.java file to fix compile.
1 parent 2589735 commit a263e39

File tree

1 file changed

+15
-15
lines changed
  • src/interfaces/jdbc/org/postgresql/jdbc2

1 file changed

+15
-15
lines changed

src/interfaces/jdbc/org/postgresql/jdbc2/Array.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ public Object getArray(long index, int count, Map map) throws SQLException {
169169
}
170170

171171
public int getBaseType() throws SQLException {
172-
return Field.getSQLType( getBaseTypeName() );
172+
return conn.getSQLType(getBaseTypeName());
173173
}
174174

175175
public String getBaseTypeName() throws SQLException {
176-
String fType = field.getTypeName();
176+
String fType = field.getPGType();
177177
if( fType.charAt(0) == '_' )
178178
fType = fType.substring(1);
179179
return fType;
@@ -195,24 +195,24 @@ public java.sql.ResultSet getResultSet(long index, int count, java.util.Map map)
195195
Object array = getArray( index, count, map );
196196
Vector rows = new Vector();
197197
Field[] fields = new Field[2];
198-
fields[0] = new Field(conn, "INDEX", field.getOID("int2"), 2);
198+
fields[0] = new Field(conn, "INDEX", conn.getOID("int2"), 2);
199199
switch ( getBaseType() )
200200
{
201201
case Types.BIT:
202202
boolean[] booleanArray = (boolean[]) array;
203-
fields[1] = new Field(conn, "VALUE", field.getOID("bool"), 1);
203+
fields[1] = new Field(conn, "VALUE", conn.getOID("bool"), 1);
204204
for( int i=0; i<booleanArray.length; i++ ) {
205205
byte[][] tuple = new byte[2][0];
206206
tuple[0] = conn.getEncoding().encode( Integer.toString((int)index+i) ); // Index
207207
tuple[1] = conn.getEncoding().encode( (booleanArray[i]?"YES":"NO") ); // Value
208208
rows.addElement(tuple);
209209
}
210210
case Types.SMALLINT:
211-
fields[1] = new Field(conn, "VALUE", field.getOID("int2"), 2);
211+
fields[1] = new Field(conn, "VALUE", conn.getOID("int2"), 2);
212212
case Types.INTEGER:
213213
int[] intArray = (int[]) array;
214214
if( fields[1] == null )
215-
fields[1] = new Field(conn, "VALUE", field.getOID("int4"), 4);
215+
fields[1] = new Field(conn, "VALUE", conn.getOID("int4"), 4);
216216
for( int i=0; i<intArray.length; i++ ) {
217217
byte[][] tuple = new byte[2][0];
218218
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)
222222
break;
223223
case Types.BIGINT:
224224
long[] longArray = (long[]) array;
225-
fields[1] = new Field(conn, "VALUE", field.getOID("int8"), 8);
225+
fields[1] = new Field(conn, "VALUE", conn.getOID("int8"), 8);
226226
for( int i=0; i<longArray.length; i++ ) {
227227
byte[][] tuple = new byte[2][0];
228228
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)
232232
break;
233233
case Types.NUMERIC:
234234
BigDecimal[] bdArray = (BigDecimal[]) array;
235-
fields[1] = new Field(conn, "VALUE", field.getOID("numeric"), -1);
235+
fields[1] = new Field(conn, "VALUE", conn.getOID("numeric"), -1);
236236
for( int i=0; i<bdArray.length; i++ ) {
237237
byte[][] tuple = new byte[2][0];
238238
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)
242242
break;
243243
case Types.REAL:
244244
float[] floatArray = (float[]) array;
245-
fields[1] = new Field(conn, "VALUE", field.getOID("float4"), 4);
245+
fields[1] = new Field(conn, "VALUE", conn.getOID("float4"), 4);
246246
for( int i=0; i<floatArray.length; i++ ) {
247247
byte[][] tuple = new byte[2][0];
248248
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)
252252
break;
253253
case Types.DOUBLE:
254254
double[] doubleArray = (double[]) array;
255-
fields[1] = new Field(conn, "VALUE", field.getOID("float8"), 8);
255+
fields[1] = new Field(conn, "VALUE", conn.getOID("float8"), 8);
256256
for( int i=0; i<doubleArray.length; i++ ) {
257257
byte[][] tuple = new byte[2][0];
258258
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)
261261
}
262262
break;
263263
case Types.CHAR:
264-
fields[1] = new Field(conn, "VALUE", field.getOID("char"), 1);
264+
fields[1] = new Field(conn, "VALUE", conn.getOID("char"), 1);
265265
case Types.VARCHAR:
266266
String[] strArray = (String[]) array;
267267
if( fields[1] == null )
268-
fields[1] = new Field(conn, "VALUE", field.getOID("varchar"), -1);
268+
fields[1] = new Field(conn, "VALUE", conn.getOID("varchar"), -1);
269269
for( int i=0; i<strArray.length; i++ ) {
270270
byte[][] tuple = new byte[2][0];
271271
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)
275275
break;
276276
case Types.DATE:
277277
java.sql.Date[] dateArray = (java.sql.Date[]) array;
278-
fields[1] = new Field(conn, "VALUE", field.getOID("date"), 4);
278+
fields[1] = new Field(conn, "VALUE", conn.getOID("date"), 4);
279279
for( int i=0; i<dateArray.length; i++ ) {
280280
byte[][] tuple = new byte[2][0];
281281
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)
285285
break;
286286
case Types.TIME:
287287
java.sql.Time[] timeArray = (java.sql.Time[]) array;
288-
fields[1] = new Field(conn, "VALUE", field.getOID("time"), 8);
288+
fields[1] = new Field(conn, "VALUE", conn.getOID("time"), 8);
289289
for( int i=0; i<timeArray.length; i++ ) {
290290
byte[][] tuple = new byte[2][0];
291291
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)
295295
break;
296296
case Types.TIMESTAMP:
297297
java.sql.Timestamp[] timestampArray = (java.sql.Timestamp[]) array;
298-
fields[1] = new Field(conn, "VALUE", field.getOID("timestamp"), 8);
298+
fields[1] = new Field(conn, "VALUE", conn.getOID("timestamp"), 8);
299299
for( int i=0; i<timestampArray.length; i++ ) {
300300
byte[][] tuple = new byte[2][0];
301301
tuple[0] = conn.getEncoding().encode( Integer.toString((int)index+i) ); // Index

0 commit comments

Comments
 (0)