pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergey Pariev <egy@tnet.dp.ua>
To: pgsql-jdbc@postgresql.org
Subject: in(...) clause and PreparedStatement
Date: Mon, 13 Jun 2005 13:08:55 +0000
Message-ID: <42AD8567.10004@tnet.dp.ua> (raw)

Hi all.
    It may be stupid question, but is there way to use PreparedStatement 
with queries like
SELECT * FROM mytable WHERE t_id IN (1,2,3) ?
    I've googled but haven't found nothing explicitly said on this topic.
    I've tried the following
    PreparedStatement st = conn.prepareStatement("SELECT * FROM mytable 
WHERE t_id IN ( ? )");
    st.setObject(1,"1,2,3");

    and get error complaining on type mismatch.

    Thanks in advance, Sergey.



view thread (6+ messages)  latest in thread

Message-ID: <42AD8567.10004@tnet.dp.ua>
Permalink:  ../42AD8567.10004@tnet.dp.ua/
Also on:    postgresql.org/message-id/42AD8567.10004@tnet.dp.ua

 · 

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: egy@tnet.dp.ua
  Subject: Re: in(...) clause and PreparedStatement
  In-Reply-To: <42AD8567.10004@tnet.dp.ua>
  References: <42AD8567.10004@tnet.dp.ua>

* 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