getObject() returns integer instead of LargeObject handle ? - Mailing list pgsql-jdbc

From Marc Herbert
Subject getObject() returns integer instead of LargeObject handle ?
Date
Msg-id 20050722135640.GM7394@emicnetworks.com
Whole thread Raw
Responses Re: getObject() returns integer instead of LargeObject  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Hi,

 Is there some good reason for getObject(<some oid column>) to return the
bare oid integer instead of the actual LargeObject handle ?

 I slightly modified the driver as below and it fixed my Blob issues
without any other side-effects. Would have some extensive testing
shown some problems I missed ?  Sorry for not being very familiar with
Postgres' oids.

Thanks in advance.

Cheers,

Marc.


Index: postgresql/jdbc2/TypeInfoCache.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TypeInfoCache.java,v
retrieving revision 1.1
diff -u -r1.1 TypeInfoCache.java
--- postgresql/jdbc2/TypeInfoCache.java    10 Apr 2005 21:54:16 -0000    1.1
+++ postgresql/jdbc2/TypeInfoCache.java    22 Jul 2005 13:45:35 -0000
@@ -51,7 +51,7 @@
     private static Object types[][] = {
         {"int2", new Integer(Oid.INT2), new Integer(Types.SMALLINT), "java.lang.Short"},
         {"int4", new Integer(Oid.INT4), new Integer(Types.INTEGER), "java.lang.Integer"},
-        {"oid", new Integer(Oid.OID), new Integer(Types.INTEGER), "java.lang.Integer"},
+        {"oid", new Integer(Oid.OID), new Integer(Types.BLOB), "java.sql.Blob"},
         {"int8", new Integer(Oid.INT8), new Integer(Types.BIGINT), "java.lang.Long"},
         {"money", new Integer(Oid.MONEY), new Integer(Types.DOUBLE), "java.lang.Double"},
         {"numeric", new Integer(Oid.NUMERIC), new Integer(Types.NUMERIC), "java.math.BigDecimal"},

pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Timestamp Conversion Woes Redux
Next
From: Dave Cramer
Date:
Subject: Re: Timestamp Conversion Woes Redux