From: Oliver Jowett <oliver@opencloud.com>
To: Aaron Mulder <ammulder@alumni.princeton.edu>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Prepared Statements
Date: Sat, 19 Jul 2003 18:06:24 +1200
Message-ID: <20030719060623.GA20479@opencloud.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0307190255460.26002-100000@www.princetongames.org>
References: <20030719012555.GA20158@opencloud.com>
<Pine.LNX.4.44.0307190255460.26002-100000@www.princetongames.org>
On Sat, Jul 19, 2003 at 03:03:20AM -0400, Aaron Mulder wrote:
> I have to agree that it would be better to provide a solution
> using API calls than a solutions that requires one to send SQL syntax
> into a ?.
>
> But why can't we kill both birds with an implementation of
> java.sql.Array? If you need to use an Array, you can use a PGArray that
> wraps an Object[]. If you want to do an in clause, do "where foo in (?)"
> or "where foo in ?" and then use ps.setArray() instead of setObject().
> Then we can make the docs explicit on this.
setArray() needs to generate "'{1,2,3}'" for an array field, but you want
"(1,2,3)" for an IN clause. Requiring the JDBC driver to parse the query to
distinguish the two cases seems awkward.
-O
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: oliver@opencloud.com, ammulder@alumni.princeton.edu
Subject: Re: Prepared Statements
In-Reply-To: <20030719060623.GA20479@opencloud.com>
References: <20030719012555.GA20158@opencloud.com> <Pine.LNX.4.44.0307190255460.26002-100000@www.princetongames.org> <20030719060623.GA20479@opencloud.com>
* 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