Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 45450 invoked from network); 23 Sep 2005 17:23:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Sep 2005 17:23:42 -0000 Received: (qmail 55173 invoked by uid 500); 23 Sep 2005 17:23:37 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 54711 invoked by uid 500); 23 Sep 2005 17:23:35 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 54558 invoked by uid 99); 23 Sep 2005 17:23:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2005 10:23:33 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=SPF_HELO_FAIL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.142] (HELO e2.ny.us.ibm.com) (32.97.182.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2005 10:23:41 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j8NHNBw2001780 for ; Fri, 23 Sep 2005 13:23:11 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j8NHNBBd100824 for ; Fri, 23 Sep 2005 13:23:11 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j8NHN5bg015067 for ; Fri, 23 Sep 2005 13:23:06 -0400 Received: from [9.48.108.97] (sig-9-48-108-97.mts.ibm.com [9.48.108.97]) by d01av04.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j8NHN5EQ014733 for ; Fri, 23 Sep 2005 13:23:05 -0400 Message-ID: <43343919.1060501@Sourcery.Org> Date: Fri, 23 Sep 2005 10:19:21 -0700 From: Satheesh Bandaram User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: JDBC and WHERE IN clauses References: <1121180210.30679.ezmlm@db.apache.org> <4333AC62.1060008@cibecs.com> In-Reply-To: <4333AC62.1060008@cibecs.com> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Don't think you can do this in Derby. However, you can do: SELECT * FROM Names WHERE ID IN (?, ?, ?) and bind individual elements of the array to each of the parameters. This, of course, forces you to know the number of elements of the array.. Satheesh Tony Seebregts wrote: > Hi, > > Does anybody know of a way to use a PreparedStatement with a WHERE IN > (?) clause > > e.g. SELECT * FROM Names WHERE ID IN (?) > > where the parameter is replaced by an array of e.g. int's ? > > regards > > Tony Seebregts > > > >