Re: Prepared Statements - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Prepared Statements
Date
Msg-id 20030719060623.GA20479@opencloud.com
Whole thread Raw
In response to Re: Prepared Statements  (Aaron Mulder <ammulder@alumni.princeton.edu>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Aaron Mulder
Date:
Subject: Re: Prepared Statements
Next
From: pginfo
Date:
Subject: jdbc batch performance problem