Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 339041337BFE for ; Sun, 3 Apr 2011 17:41:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 73311-03-3 for ; Sun, 3 Apr 2011 20:41:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.intergenia.de [217.118.26.141]) by mail.postgresql.org (Postfix) with ESMTP id AADE21337C4C for ; Sun, 3 Apr 2011 17:40:49 -0300 (ADT) Received: from radek.localnet (87-204-194-135.dg-net.pl [87.204.194.135]) by mail.softperience.eu (Postfix) with ESMTPA id B8A06C000B0; Sun, 3 Apr 2011 22:40:45 +0200 (CEST) From: =?utf-8?q?Rados=C5=82aw_Smogura?= To: pgsql-jdbc@postgresql.org Subject: Re: JDBC4 Binary Mode with Arrays Date: Sun, 3 Apr 2011 22:40:41 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.36-gentoo-r8; KDE/4.4.5; x86_64; ; ) Cc: bubba postgres References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201104032240.41399.rsmogura@softperience.eu> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/11 X-Sequence-Number: 21737 bubba postgres Friday 01 April 2011 20:44:32 > Sorry for the cross post, I put this on general first: > > In my current application I am sending a lot of data to/from the DB with > JDBC, and specifically arrays of Double. (or even Double[][]). > I have been converting everything into a string representation of the array > with StringBuffer, which eats a lot of memory. > > I note that there is this web page: > http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer > > Which made me think I might be saved. > > After trying out the JDBC4 driver in DBCP, I see that > Connection.createArray(...) still just creates a big string under the > covers. Is that the expected behavior? Am I doing it wrong? > Will the String get converted to binary representation again before hitting > the wire? > > Regards, > -JD I developed some experimental driver, with support for binary mode, and it's only supported mode right now. I'll be glad if You try it: http://softperience.eu/pages/cmn/ngpgjdbc.xhtml Regards, Radoslaw Smogura