Home > Archive > PostgreSQL JDBC > July 2005 > getObject(<oid>) returns integer instead of LargeObject handle ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author getObject(<oid>) returns integer instead of LargeObject handle ?
Marc Herbert

2005-07-22, 9:26 am

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"},

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com