Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4sUY-0001bf-JJ for pgsql-jdbc@arkaria.postgresql.org; Sun, 19 Jan 2014 13:32:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W4sUX-0006kc-Rt for pgsql-jdbc@arkaria.postgresql.org; Sun, 19 Jan 2014 13:32:45 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4sUX-0006kW-7H for pgsql-jdbc@postgresql.org; Sun, 19 Jan 2014 13:32:45 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4sSU-00076Y-Uy for pgsql-jdbc@postgresql.org; Sun, 19 Jan 2014 13:30:41 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W4sSQ-00054X-8D for pgsql-jdbc@postgresql.org; Sun, 19 Jan 2014 14:30:34 +0100 Received: from ppp-82-135-66-214.dynamic.mnet-online.de ([82.135.66.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jan 2014 14:30:34 +0100 Received: from spam_eater by ppp-82-135-66-214.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jan 2014 14:30:34 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: Will Connection.createBlob be implemented any time soon? Date: Sun, 19 Jan 2014 14:31:00 +0100 Lines: 19 Message-ID: References: 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-82-135-66-214.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Andreas Joseph Krogh wrote on 19.01.2014 14:14: > $subject > It'd be nice to be able to do: > val b = con.createBlob() > val os = b.setBinaryStream(1) > IOUtils.copyLarge(is, os, new Array[Byte](1024 * 1024)) > Is there a work-around for it? Using PreparedStatement.setBinaryStream() works without problems. You don't even need the intermediate Blob instance: PreparedStatement pstmt = con.createStatement("...."); pstmt.setBinaryStream(1, is); or pstmt.setBinaryStream(1, is, length); // if the length is known -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc