Re: JDBC:Using Large Objects - Mailing list pgsql-interfaces

From herouth maoz
Subject Re: JDBC:Using Large Objects
Date
Msg-id Pine.GSO.4.05_heb2.07.9906230007430.18910-100000@shaked.cc.openu.ac.il
Whole thread Raw
In response to Re: JDBC:Using Large Objects  (Steffen Zimmert <szimmert@crcg.edu>)
List pgsql-interfaces
On Tue, 22 Jun 1999, Steffen Zimmert wrote:

> > Well, if it's defined as an oid, and you pass an array of bytes to it, it
> > certainly won't work. An oid is a four-byte integer, not a byte array.
> 
> I see. But this is the way it is described in the JDBC docs, at page
> 167. Is there a way to save a Byte array in the PostgreSQL database?

That's something else. I don't have the JDBC guide in front of me at this
minute, but I think you refer to a stream, not a byte array. The normal
method of setting a stream, when and if it is implemented, hides behind it
the creation of a large object, and stores that large object in the place
where objects are stored, and places the oid in the field in the table.

I don't think the same applies to a byte array. In any case, I would
expect byte arrays to be stored in byte-array fields.

However, I wouldn't recommend you to create a byte array, because then its
size is limited to the 8k upper boundary of a row in PostgreSQL. If you
know that this is going to be the size of your objects, fine. Define it
like that. Otherwise, use the special large object interface Peter added
to the JDBC driver. It doesn't require additional stuff beyond what's
already in the driver, if that's what you are afraid of.

Herouth



pgsql-interfaces by date:

Previous
From: James Olin Oden
Date:
Subject: Re: [INTERFACES] Perl Interface
Next
From: Daren Sefcik
Date:
Subject: Solaris + ColdFusion + PostgreSQL + ODBC