Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group