Re: JDBC:Using Large Objects

From: herouth maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Steffen Zimmert <szimmert(at)crcg(dot)edu>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: JDBC:Using Large Objects
Date: 1999-06-22 21:12:51
Message-ID: Pine.GSO.4.05_heb2.07.9906230007430.18910-100000@shaked.cc.openu.ac.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steffen Zimmert 1999-06-22 21:51:08 Re: [INTERFACES] JDBC:Using Large Objects
Previous Message Steffen Zimmert 1999-06-22 19:04:01 Re: JDBC:Using Large Objects

Browse pgsql-interfaces by date

  From Date Subject
Next Message Steffen Zimmert 1999-06-22 21:51:08 Re: [INTERFACES] JDBC:Using Large Objects
Previous Message James Olin Oden 1999-06-22 20:37:04 Re: [INTERFACES] Perl Interface