Re: JDBC4 Binary Mode with Arrays

From: Kris Jurka <books(at)ejurka(dot)com>
To: bubba postgres <bubba(dot)postgres(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC4 Binary Mode with Arrays
Date: 2011-04-02 06:43:06
Message-ID: alpine.BSO.2.00.1104020241090.26245@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, 1 Apr 2011, bubba postgres wrote:

> 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
>
> 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?
>

That page is about work in progress, not about the behavior of the
production driver. So you are correct that the transfer is being done
with string representation currently.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2011-04-02 08:46:18 Re: PreparedStatement batch statement impossible
Previous Message bubba postgres 2011-04-01 18:44:32 JDBC4 Binary Mode with Arrays