Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8D9BB6325FD for ; Tue, 7 Apr 2009 18:42:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 86263-05 for ; Tue, 7 Apr 2009 18:42:01 -0300 (ADT) X-Greylist: delayed 07:02:36.752337 by SQLgrey-1.7.6 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mail.postgresql.org (Postfix) with ESMTP id 1A6B96337EE for ; Tue, 7 Apr 2009 18:42:00 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LrJ3I-0004Tc-36 for pgsql-jdbc@postgresql.org; Tue, 07 Apr 2009 21:41:52 +0000 Received: from ppp-88-217-14-88.dynamic.mnet-online.de ([88.217.14.88]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Apr 2009 21:41:52 +0000 Received: from spam_eater by ppp-88-217-14-88.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Apr 2009 21:41:52 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: BLOB help - yes I've read around! Date: Tue, 07 Apr 2009 23:41:53 +0200 Lines: 16 Message-ID: References: <49DB559F.3030805@yahoo.co.uk> <200904071657.08065.achill@matrix.gatewaynet.com> <49DB5D63.5040103@yahoo.co.uk> <49DBC6DC.5030609@yahoo.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-88-217-14-88.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 In-Reply-To: <49DBC6DC.5030609@yahoo.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200904/26 X-Sequence-Number: 19473 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