in(...) clause and PreparedStatement

From: Sergey Pariev <egy(at)tnet(dot)dp(dot)ua>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: in(...) clause and PreparedStatement
Date: 2005-06-13 13:08:55
Message-ID: 42AD8567.10004@tnet.dp.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andrés Luna 2005-06-13 13:13:52 Re: Getting Reference cursors
Previous Message Dave Cramer 2005-06-13 13:07:11 Re: in(...) clause and PreparedStatement