pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Silvio Bierman <sbierman@jambo-software.com>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: FW: PreparedStatement#setString on non-string parameters
Date: Wed, 09 Mar 2005 10:47:34 +1300
Message-ID: <422E1D76.6080307@opencloud.com> (raw)
In-Reply-To: <JGEOKLDJHLJNAPFIBKBNMEIHDCAA.sbierman@jambo-software.com>
References: <JGEOKLDJHLJNAPFIBKBNMEIHDCAA.sbierman@jambo-software.com>

Silvio Bierman wrote:

> Either the JDBC drivers for the databases I mentioned earlier do the
> conversion or the database backends do it on the server side. Any way, this
> works in all cases. PostgreSQL is the first database to break our
> application due to this behaviour. We have had problems on earlier versions
> of MySQL because of lack of subselect support etc. but never these issues.

I'd suggest using CAST in your SQL -- that in theory should work 
everywhere and reflects your application's intent (to interpret a string 
as a numeric value).

The problem with reverting to the old way of doing parameters (direct 
text substitution into the query) is that we cannot take advantage of 
most of the new stuff in the V3 protocol -- that means no server-side 
prepared statement reuse, no low-overhead transfer of large parameters, 
and reduced support for cursor-based resultsets.

-O



view thread (14+ messages)  latest in thread

Message-ID: <422E1D76.6080307@opencloud.com>
Permalink:  ../422E1D76.6080307@opencloud.com/
Also on:    postgresql.org/message-id/422E1D76.6080307@opencloud.com

 · 

reply

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: oliver@opencloud.com, sbierman@jambo-software.com
  Subject: Re: FW: PreparedStatement#setString on non-string parameters
  In-Reply-To: <422E1D76.6080307@opencloud.com>
  References: <JGEOKLDJHLJNAPFIBKBNMEIHDCAA.sbierman@jambo-software.com> <422E1D76.6080307@opencloud.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