Re: BLOB help - yes I've read around! - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Re: BLOB help - yes I've read around!
Date
Msg-id grgham$q84$1@ger.gmane.org
Whole thread Raw
In response to Re: BLOB help - yes I've read around!  (Brad Milne <mail_4brad@yahoo.co.uk>)
Responses Re: BLOB help - yes I've read around!  (Brad Milne <mail_4brad@yahoo.co.uk>)
List pgsql-jdbc
Brad Milne wrote on 07.04.2009 23:34:
> For completeness, here is the setter again
> with a couple of fixes:
>
> stmt.setBinaryStream(2,in,in.available());

Do not use availabe()

This will *not* give you the number of bytes that are "available" in the stream.

Read the Javadocs carefully: it will give you the number of bytes that can be
/read without blocking/

Most of the time this will not be the length of the stream.

Thomas

pgsql-jdbc by date:

Previous
From: Brad Milne
Date:
Subject: Re: BLOB help - yes I've read around!
Next
From: Brad Milne
Date:
Subject: Re: BLOB help - yes I've read around!