pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC4 Binary Mode with Arrays
3+ messages / 3 participants
[nested] [flat]

* JDBC4 Binary Mode with Arrays
@ 2011-04-01 18:44  bubba postgres <bubba.postgres@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: bubba postgres @ 2011-04-01 18:44 UTC (permalink / raw)
  To: pgsql-jdbc

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: JDBC4 Binary Mode with Arrays
@ 2011-04-02 06:43  Kris Jurka <books@ejurka.com>
  parent: bubba postgres <bubba.postgres@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Kris Jurka @ 2011-04-02 06:43 UTC (permalink / raw)
  To: bubba postgres <bubba.postgres@gmail.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: JDBC4 Binary Mode with Arrays
@ 2011-04-03 20:40  Radosław Smogura <rsmogura@softperience.eu>
  parent: bubba postgres <bubba.postgres@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Radosław Smogura @ 2011-04-03 20:40 UTC (permalink / raw)
  To: pgsql-jdbc; +Cc: bubba postgres <bubba.postgres@gmail.com>

bubba postgres <bubba.postgres@gmail.com> 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-04-03 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-01 18:44 JDBC4 Binary Mode with Arrays bubba postgres <bubba.postgres@gmail.com>
2011-04-02 06:43 ` Kris Jurka <books@ejurka.com>
2011-04-03 20:40 ` Radosław Smogura <rsmogura@softperience.eu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox