mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Attached is a patch to fix the current issues with building under jdbc1.
This patch moves the logic that looks up TypeOid, PGTypeName, and SQLTypeName from Field to Connection. It is moved to connection since it needs to differ from the jdbc1 to jdbc2 versions and Connection already has different subclasses for the two driver versions. It also made sense to move the logic to Connection as some of the logic was already there anyway. Barry Lind
This commit is contained in:
@ -782,7 +782,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
|
||||
case Types.BIGINT:
|
||||
return new Long(getLong(columnIndex));
|
||||
case Types.NUMERIC:
|
||||
return getBigDecimal(columnIndex, ((field.mod-4) & 0xffff));
|
||||
return getBigDecimal(columnIndex, ((field.getMod()-4) & 0xffff));
|
||||
case Types.REAL:
|
||||
return new Float(getFloat(columnIndex));
|
||||
case Types.DOUBLE:
|
||||
@ -800,7 +800,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
|
||||
case Types.VARBINARY:
|
||||
return getBytes(columnIndex);
|
||||
default:
|
||||
return connection.getObject(field.getTypeName(), getString(columnIndex));
|
||||
return connection.getObject(field.getPGType(), getString(columnIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -836,7 +836,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
|
||||
int i;
|
||||
|
||||
for (i = 0 ; i < fields.length; ++i)
|
||||
if (fields[i].name.equalsIgnoreCase(columnName))
|
||||
if (fields[i].getName().equalsIgnoreCase(columnName))
|
||||
return (i+1);
|
||||
throw new PSQLException ("postgresql.res.colname",columnName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user