pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: jao@geophile.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Array support in 8.1 JDBC driver
Date: Tue, 28 Mar 2006 15:56:42 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0603281552010.189@leary.csoft.net> (raw)
In-Reply-To: <20060328120922.j4j45ztgsgc4go40@geophile.com>
References: <20060328120922.j4j45ztgsgc4go40@geophile.com>



On Tue, 28 Mar 2006, jao@geophile.com wrote:

> I'm not sure I understand this. It sounds like the array is converted
> to a string. Is the string then just pasted into the query?  What does
> this to to the use of server-side prepared statements? I'd like to
> avoid parsing the "same" statement repeatedly due to the use of
> arrays.
>
> Or is the string then somehow used to bind an array to the prepared
> statement?

Yes.  The conversion to string is for the bind parameter.  Basically 
setArray takes a java.sql.Array not something like int[].  We also require 
a very specific implementation of the java.sql.Array interface to be 
passed to the setArray function.  The requirements are that getBaseType 
return the correct type value and that calling toString returns the data 
in the format that the postgresql server expects for a bind variable.

Kris Jurka



view thread (2+ messages)

Message-ID: <Pine.BSO.4.63.0603281552010.189@leary.csoft.net>
Permalink:  ../Pine.BSO.4.63.0603281552010.189@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.63.0603281552010.189@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, jao@geophile.com
  Subject: Re: Array support in 8.1 JDBC driver
  In-Reply-To: <Pine.BSO.4.63.0603281552010.189@leary.csoft.net>
  References: <20060328120922.j4j45ztgsgc4go40@geophile.com> <Pine.BSO.4.63.0603281552010.189@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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