Streaming Blobs in PG 8.3 - Mailing list pgsql-jdbc

From David Wall
Subject Streaming Blobs in PG 8.3
Date
Msg-id 49220C79.9010909@computer.org
Whole thread Raw
List pgsql-jdbc
I've been using the JDBC setBlob/getBlob routines, that wrap the PG's LO
routines I believe, for some time and they've worked great.  But we've
always done it with all of the data in a byte array for storing and
retrieving.

We are looking to add a streaming capability and wanted to know what the
"best approach" would be in JDBC?

Read streaming with a Blob seems pretty straightforward since even our
byte array version calls getBinaryStream() and then reads it into the
array.  But writing seems a bit less clear since I'm not sure how I get
the data into the Blob in a stream so that PG can suck it out of the
stream and write it to the database, and then how to tell my Blob that
I'm at "EOF" so that PG can also stop streaming it to the backend and
complete the LO.

I'd prefer to use pure JDBC, but is this easily accomplished (examples?)
or should I look to use the PG-specific LO routines directly in the JDBC
library?

Thanks,
David


pgsql-jdbc by date:

Previous
From: "Don Pannese"
Date:
Subject: Re: Java 6 support for org.postgresql.ds.PGPoolingDataSource
Next
From: "Reuben Cummings"
Date:
Subject: neooffice form problem with numerics