From: Csaba Nagy <nagy@ecircle-ag.com>
To: Fernando Nasser <fnasser@redhat.com>
Cc: Dmitry Tkach <dmitry@openratings.com>
Cc: Barry Lind <blind@xythos.com>
Cc: wsheldah@lexmark.com
Cc: pgsql-jdbc @ postgresql " ". org <pgsql-jdbc@postgresql.org>
Subject: Re: Prepared Statements
Date: 18 Jul 2003 17:32:34 +0200
Message-ID: <1058542355.24801.309.camel@coppola.ecircle.de> (raw)
In-Reply-To: <3F181054.5080707@redhat.com>
References: <OFBD7C18F4.2499D62A-ON85256D66.005245AA@lexmark.com>
<3F174BFF.3070704@xythos.com>
<3F1801C5.9030104@openratings.com>
<3F18065A.1060406@redhat.com>
<3F180FB2.3090408@openratings.com>
<3F181054.5080707@redhat.com>
>
> 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.
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: nagy@ecircle-ag.com, fnasser@redhat.com, dmitry@openratings.com, blind@xythos.com, wsheldah@lexmark.com
Subject: Re: Prepared Statements
In-Reply-To: <1058542355.24801.309.camel@coppola.ecircle.de>
References: <OFBD7C18F4.2499D62A-ON85256D66.005245AA@lexmark.com> <3F174BFF.3070704@xythos.com> <3F1801C5.9030104@openratings.com> <3F18065A.1060406@redhat.com> <3F180FB2.3090408@openratings.com> <3F181054.5080707@redhat.com> <1058542355.24801.309.camel@coppola.ecircle.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