Re: IN clause with PreparedStatement

From: Kris Jurka <books(at)ejurka(dot)com>
To: Ingmar Lötzsch <iloetzsch(at)asci-systemhaus(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: IN clause with PreparedStatement
Date: 2007-07-18 21:09:35
Message-ID: Pine.BSO.4.64.0707181708370.14666@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 18 Jul 2007, Ingmar Lötzsch 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message roman 2007-07-19 04:20:18 Using bytea with ResultSet.getBytes("..."). Problem. Help!!
Previous Message Kris Jurka 2007-07-18 21:00:18 Re: jdbc supports struct?