Re: Continuing problems with using OIDs via JDBC - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Continuing problems with using OIDs via JDBC
Date
Msg-id 3C5335B3.9090202@xythos.com
Whole thread Raw
In response to Re: Continuing problems with using OIDs via JDBC  ("M. A. Sridhar" <m_a_sridhar@yahoo.com>)
Responses Re: Continuing problems with using OIDs via JDBC (solved)  ("M. A. Sridhar" <m_a_sridhar@yahoo.com>)
List pgsql-jdbc
Sridhar,

If you use the 7.2 jdbc driver (which is compatible with a 7.1 database)
you should look at the latest documentation for jdbc from 7.2.  The blob
support in the jdbc driver has changed significantly in the 7.2 version
of the driver and the doc should explain the differences.  You can
access the 7.2 documentation at
http://candle.pha.pa.us/main/writings/pgsql/sgml/jdbc.html

If you still are having problems please post a test case that exhibits
the problem to the maillist.

thanks,
--Barry


M. A. Sridhar wrote:

> Nick,
>
> Thanks for the quick response. No joy, though -- I get the same oidin error
> with this driver.
>
> Sridhar
>
> --- Nick Fankhauser <nickf@ontko.com> wrote:
>
>>Sridhar-
>>
>>There is a newer driver than the two you listed. Try:
>>
>>http://jdbc.postgresql.org/download/jdbc7.2dev-1.2.jar
>>
>>Although listed as development, this is pretty stable and will work with
>>postgresql 7.1.
>>
>>I haven't tried using it for large objects, so I can't say for sure it
>>will
>>help, but it's worth trying while you wait for other responses from the
>>list.
>>
>>-Nick
>>
>>
>>
> --------------------------------------------------------------------------
>
>>Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax
>>1.765.962.9788
>>Ray Ontko & Co.     Software Consulting Services
>>http://www.ontko.com/
>>
>>
>>>-----Original Message-----
>>>From: pgsql-jdbc-owner@postgresql.org
>>>[mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of M. A. Sridhar
>>>Sent: Saturday, January 26, 2002 5:05 PM
>>>To: pgsql-jdbc@postgresql.org
>>>Subject: [JDBC] Continuing problems with using OIDs via JDBC
>>>
>>>
>>>Hello folks,
>>>
>>>I would greatly appreciate some help with using large objects in
>>>PostgreSQL
>>>via JDBC. I need to create a JDBC-compliant database application tha
>>>supports multiple database vendors, so using any PostgreSQL-specific
>>>extensions is difficult. I am trying to replace my current
>>>
>>Oracle-on-Linux
>>
>>>setup with PostgreSQL, and not having much luck.
>>>
>>>My setup is Red Hat Linux 7.1 (or 7.2) running the IBM JDK 1.3. I have
>>>installed the PostgreSQL version distributed via the stock Red
>>>Hat RPMs for
>>>that OS version.
>>>
>>>Also, I am a relative newbie to PostgreSQL, although I have worked with
>>>other databases (Oracle and Pointbase in particular). So please
>>>forgive any
>>>errors/omissions on my part.
>>>
>>>I need to store and retrieve large binary objects. To this end, I have
>>>followed the directions in the JDBC documentation distributed with the
>>>PostgreSQL package. Specifically I use the oid data type wherever a
>>>
>>large
>>
>>>object is needed, and the ResultSet's setBinaryStream/getBinaryStream
>>>methods to store and retrieve data.
>>>
>>>When I try this setup using the JDBC 7.1-1.2 drivers, the problem that
>>>arises is the driver's inability to handle null values:
>>>
>>>FastPath call returned ERROR:  inv_open: large object 0 not found
>>>
>>>I would expect that, if the value is null, the driver would return null
>>>instead of throwing an exception.
>>>
>>>I found reports of this bug on Google and the PostgreSQL mailing list,
>>>
>>and
>>
>>>the recommendation was to use the newer drivers. Well, that doesn't
>>>
>>work
>>
>>>either: both the 7.1-1.2 and 7.1-1.3 drivers (which I downloaded from
>>>jdbc.fastcrypt.com) fail with an error like
>>>
>>>java.sql.SQLException: ERROR:  oidin: error in "..."
>>>
>>>when I try to insert a record containing a blob.
>>>
>>>And yes, I do use setAutoCommit to ensure that retrievals/updates
>>>
>>happen
>>
>>>within a transaction, as described in the JDBC documentation.
>>>
>>>So I am now unable to use PostgreSQL. Any help is greatly appreciated.
>>>
>>I
>>
>>>will be glad to give more details (e.g., source code snippets) to
>>>
>>clarify
>>
>>>if needed.
>>>
>>>Thanks in advance.
>>>
>>>
>>>
>>>=====
>>>Sridhar
>>>---
>>>M. A. Sridhar
>>>m_a_sridhar@yahoo.com
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Great stuff seeking new owners in Yahoo! Auctions!
>>>http://auctions.yahoo.com
>>>
>>>---------------------------(end of
>>>
>>broadcast)---------------------------
>>
>>>TIP 2: you can get off all lists at once with the unregister command
>>>    (send "unregister YourEmailAddressHere" to
>>>
>>majordomo@postgresql.org)
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions!
> http://auctions.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>



pgsql-jdbc by date:

Previous
From: "Nick Fankhauser"
Date:
Subject: Re: Continuing problems with using OIDs via JDBC
Next
From: "M. A. Sridhar"
Date:
Subject: Re: Continuing problems with using OIDs via JDBC (solved)