Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 80B4D9FBE89 for ; Wed, 18 Jul 2007 18:09:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 71819-04 for ; Wed, 18 Jul 2007 18:09:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 47B7B9FBDB0 for ; Wed, 18 Jul 2007 18:09:36 -0300 (ADT) Received: (qmail 16843 invoked by uid 1112); 18 Jul 2007 21:09:35 -0000 Date: Wed, 18 Jul 2007 17:09:35 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: =?ISO-8859-15?Q?Ingmar_L=F6tzsch?= cc: pgsql-jdbc@postgresql.org Subject: Re: IN clause with PreparedStatement In-Reply-To: <469E34E6.3010002@asci-systemhaus.de> Message-ID: References: <469E34E6.3010002@asci-systemhaus.de> MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 200707/85 X-Sequence-Number: 17259 On Wed, 18 Jul 2007, Ingmar L=F6tzsch wrote: > SELECT * > FROM table1 > WHERE id IN (1, 2, 3); > > whereas the list 1, 2, 3 must be created dynamically. The goal is to > avoid n queries for single objects instead of one query. I can > concatenate the statement and use Statement. But I can't figure out, how > to use PreperedStatement. Can you help me? > This identical thread concluded with a perl example that is relevant. http://archives.postgresql.org/pgsql-jdbc/2007-06/msg00015.php Kris Jurka