Re: upgrade problem with driver postgresql-8.1-407.jdbc3.jar - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: upgrade problem with driver postgresql-8.1-407.jdbc3.jar
Date
Msg-id 44FF3043.3030901@opencloud.com
Whole thread Raw
In response to Re: upgrade problem with driver postgresql-8.1-407.jdbc3.jar  (David Gagnon <dgagnon@siunik.com>)
List pgsql-jdbc
David Gagnon wrote:
> Is that a bug then since this way working with the 7.4 jdbc driver ?

It's not really a bug, it's that the driver is now more picky about
where parameters may be placed in the query. You were never really meant
to put parameters just anywhere in a query, it just happened to work in
the past.

> Any idea why it stops working ?

The older driver you used did literal substitution of parameter values
into the query.

Newer drivers turn ? placeholders into $n placeholders and pass the
actual parameter values separately to the query string. So they only
allow ? placeholders where a $n placeholder is accepted by the server.

-O

pgsql-jdbc by date:

Previous
From: David Gagnon
Date:
Subject: Re: upgrade problem with driver postgresql-8.1-407.jdbc3.jar
Next
From: Dave Cramer
Date:
Subject: Re: Moving to pgfoundry