Re: SIGBUS in AllocSetAlloc & jdbc - Mailing list pgsql-hackers

From Peter T Mount
Subject Re: SIGBUS in AllocSetAlloc & jdbc
Date
Msg-id Pine.LNX.4.04.9904291836390.2109-100000@maidast.retep.org.uk
Whole thread Raw
In response to SIGBUS in AllocSetAlloc & jdbc  (Brian P Millett <bpm@ec-group.com>)
Responses Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
On Thu, 29 Apr 1999, Brian P Millett wrote:

> Peter, I hope this long and boring message can shed some light on my
> difficulties getting jdbc & postgres6.5b1(current snapshot) to work
> with blobs.  I have NO problem with text, numeric, etc.  Just blobs &
> the LO interface.
> 
> I feel that it is a 64 vs 32 bit memory management problem.

At first glance, the JDBC code looks ok. In fact it is similar to the
ImageViewer example that's included with the source.

Do you get the same problem when using ImageViewer?

>      // Getting the value of the item_picture column and
>      // displaying it
>      System.err.println("Got oid "+queryResults.getInt(2));
>      byte itemPictureArray [] = queryResults.getBytes(2);
>      if (itemPictureArray != null) {
>       Image img =
> Toolkit.getDefaultToolkit().createImage(itemPictureArray);
>       itemPictureCanvas.setImage(img);
>       itemPictureCanvas.repaint();
>      }

Using an array is perfectly valid, and the driver does support this method
of getting an Image from a BLOB.

Tip: The JDBC spec says you should only read a field once. However, with
our driver, this is ok.

I'm not sure about the backend, but the JDBC side looks fine.

Peter

--       Peter T Mount peter@retep.org.uk     Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgresJava PDF Generator: http://www.retep.org.uk/pdf



pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] v6.5 Release Date ...
Next
From: José Soares
Date:
Subject: Re: [SQL] LIMIT