Re: BLOB help - yes I've read around!

From: Brad Milne <mail_4brad(at)yahoo(dot)co(dot)uk>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Subject: Re: BLOB help - yes I've read around!
Date: 2009-04-07 21:55:14
Message-ID: 49DBCBC2.6080402@yahoo.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thomas Kellerer wrote:
> 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.
>
Good point Thomas, I hear you. I shouldn't have written that hear as
others could follow that. In my implementation it is ok as the stream is
complete prior to persisting it. I have an AudioInputStream object, but
it is always complete. If you think I should be therefore using a
different method/db object then I'd be pleased to hear.

Thanks
Brad

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2009-04-08 02:16:46 Re: Array passing
Previous Message Thomas Kellerer 2009-04-07 21:41:53 Re: BLOB help - yes I've read around!