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 BFB1BCCCF0 for ; Fri, 18 Jul 2003 15:32:21 +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 32785-05 for ; Fri, 18 Jul 2003 15:32:43 +0000 (GMT) Received: from webmail.muc.domues.com (webmail.muc.domeus.com [62.67.54.176]) by svr1.postgresql.org (Postfix) with ESMTP id 5707ACC00C for ; Fri, 18 Jul 2003 12:32:09 -0300 (ADT) Received: from coppola.ecircle.de ([192.168.1.142]) by webmail.muc.domues.com (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id h6IFWYk05528; Fri, 18 Jul 2003 17:32:34 +0200 Subject: Re: Prepared Statements From: Csaba Nagy To: Fernando Nasser Cc: Dmitry Tkach , Barry Lind , wsheldah@lexmark.com, "pgsql-jdbc @ postgresql " ". org" In-Reply-To: <3F181054.5080707@redhat.com> References: <3F174BFF.3070704@xythos.com> <3F1801C5.9030104@openratings.com> <3F18065A.1060406@redhat.com> <3F180FB2.3090408@openratings.com> <3F181054.5080707@redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-11) Date: 18 Jul 2003 17:32:34 +0200 Message-Id: <1058542355.24801.309.camel@coppola.ecircle.de> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/132 X-Sequence-Number: 7516 > > Well, I guess the bug will have be fixed asap as it is a security risk. > > What is the proper JDBC way for filling IN lists in prepared statements? > I'm no JDBC expert, but the way we do it: create a prepared statement with 100 (or whatever the max nr. of accepted params is) parameter placeholders, and set the ones which are actually needed to their parameter values, and set the rest to null. The nulls will be finally ignored by the database. Not the best solution, but it works just fine for us. Cheers, Csaba.