Re: How to retieve binary data (bytea) without problem ?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Alfredo Rico <alfredorico(at)gmail(dot)com>
Cc: Russell Francis <rfrancis(at)ev(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to retieve binary data (bytea) without problem ?
Date: 2005-09-29 17:06:13
Message-ID: Pine.BSO.4.61.0509291201150.25137@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 29 Sep 2005, Alfredo Rico wrote:

> Your suggest is very correct and in fact it works very well but only if the
> file size is under 10 MB,
> The problem happens just at moment to execute:
> InputStream ins = rs.getBinaryStream( 1 );
>

The JDBC driver can stream data going to the server (setBinaryStream), but
cannot stream data returning from the server (getBinaryStream) because of
protocol limitations. You have two options:

Switch from using bytea to large objects (Blobs). Large objects were
designed to work with much larger data sizes and have a complete streaming
interface.

Increase the JVM's heap size. Since you are using netbeans and you
haven't received many helpful suggestions here, you might try a netbeans
specific list for suggestions on how to accomplish this.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-09-29 17:12:50 Re: queries against CIDR fail against 8.0.3?
Previous Message Kris Jurka 2005-09-29 16:57:46 Re: setObject(col, blob) throws PSQLException