From: Kim Ho <kho@redhat.com>
To: wsheldah@lexmark.com
Cc: Barry Lind <blind@xythos.com>
Cc: Dave Cramer <Dave@micro-automation.net>
Cc: pgsql-jdbc-list <pgsql-jdbc@postgresql.org>
Subject: Re: Prepared Statements
Date: 18 Jul 2003 12:03:20 -0400
Message-ID: <1058544200.19657.119.camel@topanga.toronto.redhat.com> (raw)
In-Reply-To: <OF69448676.5816D221-ON85256D67.0052BF5D@lexmark.com>
References: <OF69448676.5816D221-ON85256D67.0052BF5D@lexmark.com>
Hi,
String fields are escaped (I believe this would cover CHAR, VARCHAR,
etc)
I added the single quotes when binding numbers in my patch for
registerOutParameter and that one is going to be reviewed by Dave.
Cheers,
Kim
On Fri, 2003-07-18 at 11:10, wsheldah@lexmark.com wrote:
>
> If it only skips the escaping for numeric types, the obvious workaround
> would be first put the user's entry into an int variable:
>
> int userId = getUserId();
> PreparedStatement s = c.prepareStatement ("select * from user where id
> = ?");
> s.setObject(1, userId, Types.INTEGER);
>
> That way you use java's built-in type checking to avoid sending non-numeric
> data to the backend any time you're specifying a numeric type that will
> skip the escaping.
>
> Can someone confirm that it at least does do the escaping for
> string/varchar inputs?
>
> Wes Sheldahl
>
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: kho@redhat.com, wsheldah@lexmark.com, blind@xythos.com, Dave@micro-automation.net
Subject: Re: Prepared Statements
In-Reply-To: <1058544200.19657.119.camel@topanga.toronto.redhat.com>
References: <OF69448676.5816D221-ON85256D67.0052BF5D@lexmark.com> <1058544200.19657.119.camel@topanga.toronto.redhat.com>
* 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