X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id A345ACCD97 for ; Sat, 19 Jul 2003 06:06:33 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 72366-07 for ; Sat, 19 Jul 2003 06:06:28 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 45CD4CB576 for ; Sat, 19 Jul 2003 03:05:54 -0300 (ADT) Received: from flood.opencloud.co.nz ([192.168.0.31] ident=mail) by yass.opencloud.co.nz with esmtp (Exim 3.35 #1 (Debian)) id 19dkrS-0005dZ-00; Sat, 19 Jul 2003 18:06:27 +1200 Received: from oliver by flood.opencloud.co.nz with local (Exim 3.35 #1 (Debian)) id 19dkrQ-0005Nu-00; Sat, 19 Jul 2003 18:06:24 +1200 Date: Sat, 19 Jul 2003 18:06:24 +1200 To: Aaron Mulder Cc: PostgreSQL JDBC Subject: Re: Prepared Statements Message-ID: <20030719060623.GA20479@opencloud.com> References: <20030719012555.GA20158@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i From: Oliver Jowett X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/165 X-Sequence-Number: 7549 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