RE: Large objects with JDBC

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Joachim Achtzehnter'" <joachim(at)kraut(dot)bc(dot)ca>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: Large objects with JDBC
Date: 2000-08-14 07:17:02
Message-ID: 1B3D5E532D18D311861A00600865478CF1B24B@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Which is true for any of our extensions. It's in there however, because the
standard stuff can then be implemented.

--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council

-----Original Message-----
From: Joachim Achtzehnter [mailto:joachim(at)kraut(dot)bc(dot)ca]
Sent: Sunday, August 13, 2000 8:59 PM
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Large objects with JDBC

Yesterday, in a message to pgsql-interfaces, Rob Judd wrote:
>
> I would like to save Java objects in the database. I tried a couple of
> different ways before finding one that worked, and I'd like to know if
> my first attempts failed because the functionality is missing in the
> java classes, or if I did something wrong.
>
> Serialize.create(conn, Vector.class) failed - looking in the sources it
> seemed to be missing the code to support arrays.
>
> PreparedStatement.setBinaryStream(1, InputStream, length) failed with a
> not supported exception.

You can use PreparedStatement.setBytes() as an alternative.

> I did manage to get this working eventually using a different method
> (the large object API) but the other ways seemed much more straight
> forward.

Another disadvantage of the large object API is that it is specific to
Postgresql. This can become an issue if you ever need to port to another
database, e.g. Interbase.

Joachim

--
work: joachima(at)realtimeint(dot)com (http://www.realtimeint.com)
private: joachim(at)kraut(dot)bc(dot)ca (http://www.kraut.bc.ca)

Browse pgsql-interfaces by date

  From Date Subject
Next Message Joonas Makkonen 2000-08-14 17:33:04 Connect within a db function
Previous Message Peter Mount 2000-08-14 07:13:06 RE: Large objects with JDBC