Re: Prepared Statements

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Fernando Nasser <fnasser(at)redhat(dot)com>
Cc: Dmitry Tkach <dmitry(at)openratings(dot)com>, Barry Lind <blind(at)xythos(dot)com>, wsheldah(at)lexmark(dot)com, "pgsql-jdbc (at) postgresql " "(dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Prepared Statements
Date: 2003-07-18 15:32:34
Message-ID: 1058542355.24801.309.camel@coppola.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>
> Well, I guess the bug will have be fixed asap as it is a security risk.
>
> What is the proper JDBC way for filling IN lists in prepared statements?
>

I'm no JDBC expert, but the way we do it: create a prepared statement
with 100 (or whatever the max nr. of accepted params is) parameter
placeholders, and set the ones which are actually needed to their
parameter values, and set the rest to null.
The nulls will be finally ignored by the database.
Not the best solution, but it works just fine for us.

Cheers,
Csaba.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dmitry Tkach 2003-07-18 15:41:05 Re: Prepared Statements
Previous Message Dmitry Tkach 2003-07-18 15:21:11 Re: setFetchSize()