Re: raw data broken in 7.2 driver? - Mailing list pgsql-jdbc

From David Bernhill
Subject Re: raw data broken in 7.2 driver?
Date
Msg-id 1018355419.15920.5.camel@puh.digitalroute.xx
Whole thread Raw
In response to Re: raw data broken in 7.2 driver?  (Dave Cramer <Dave@micro-automation.net>)
List pgsql-jdbc
Sure, however the problem seem to be that I didn't read the
documentation regarding the 7.2 driver properly. Doing
setBinaryStream/setBytes on a column declared as OID in the 7.2 driver
throws an exception where the converted byte[] is attached as a message.

regards David

> David,
>
> Can you send a test example which demonstrates the problems?
>
> Dave
> On Mon, 2002-04-08 at 07:03, David Bernhill wrote:
> > Good day.
> >
> > I'm having problems inserting raw data with the 7.2 jdbc driver. I've
> > tried out most of the ones available for download (Java 2). Some of them
> > seem to work with raw data in 7.2 but has problems with timestamp
> > instead. Is there any patch available for this?`For more detailed
> > description see below (found in the interactive docs).
> >
> > Comment from Adam Jenkins "<adam@thejenkins.org>":
> > "The JDBC example given above as example 8-2 does not work as
> > advertised. I'm using postgresql 7.2, and the jdbc7.2dev-1.2.jar JDBC
> > driver. It seems that the driver interprets the data it reads from the
> > InputStream passed to setBinaryStream as a binary representation of the
> > actual field value -- in this case as a binary representation of an oid.
> > This is of course incorrect; really the binary data is image data, and
> > one would hope that what the driver would do is create a new large
> > object, store the binary data in it, and store the oid of the large
> > object in the oid field. What really happens is that the driver
> > constructs a SQL statement which has the binary data which was read from
> > the InputStream embedded directly in it as the value of the oid field.
> > So executeUpdate throws a SQLException like this:
> >
> > java.sql.SQLException: ERROR: oidin: error in "213"
> >
> > regards David
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
> >
> >
>
>
>
>
> ---------------------------(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: Dave Cramer
Date:
Subject: Re: raw data broken in 7.2 driver?
Next
From: David Bernhill
Date:
Subject: Re: raw data broken in 7.2 driver?