Re: Array support in 8.1 JDBC driver

From: Kris Jurka <books(at)ejurka(dot)com>
To: jao(at)geophile(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Array support in 8.1 JDBC driver
Date: 2006-03-28 20:56:42
Message-ID: Pine.BSO.4.63.0603281552010.189@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 28 Mar 2006, jao(at)geophile(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Dorne 2006-03-29 01:41:16 Re: Printing query durations
Previous Message Kris Jurka 2006-03-28 20:47:25 Re: gcj has a lot of complaints about 8.1-405 release