pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ingmar Lötzsch <iloetzsch@asci-systemhaus.de>
To: pgsql-jdbc@postgresql.org
Subject: IN clause with PreparedStatement
Date: Wed, 18 Jul 2007 17:42:30 +0200
Message-ID: <469E34E6.3010002@asci-systemhaus.de> (raw)

Hello,

I want to submit a query like

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?

Thank you, Ingmar




view thread (3+ messages)  latest in thread

Message-ID: <469E34E6.3010002@asci-systemhaus.de>
Permalink:  ../469E34E6.3010002@asci-systemhaus.de/
Also on:    postgresql.org/message-id/469E34E6.3010002@asci-systemhaus.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: iloetzsch@asci-systemhaus.de
  Subject: Re: IN clause with PreparedStatement
  In-Reply-To: <469E34E6.3010002@asci-systemhaus.de>
  References: <469E34E6.3010002@asci-systemhaus.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox