Re: Very strange performance decrease when reusing a PreparedStatement - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Very strange performance decrease when reusing a PreparedStatement
Date
Msg-id 491f66a50905030310j5b4cdcd8jbf4f6e757c2ba580@mail.gmail.com
Whole thread Raw
In response to Re: Very strange performance decrease when reusing a PreparedStatement  (Péter Kovács <maxottovonstirlitz@gmail.com>)
Responses Re: Very strange performance decrease when reusing a PreparedStatement  (John Lister <john.lister-ps@kickstone.com>)
Re: Very strange performance decrease when reusing a PreparedStatement  (Péter Kovács <maxottovonstirlitz@gmail.com>)
List pgsql-jdbc

It appears that the Postgres "server-prepared statement" cannot handle
parameters to the statement. This is really unfortunate, because 99%
of real-life applications will want to re-use the same statement
(template) with different parameters.

The term "server-prepared statement" itself already indicates that
there may be something skewed about the "local" semantics of
java.sql.PreparedStatements in the Postgres JDBC driver. There is no
notion of "client-prepared statement" in the JDBC API, which conceives
PreparedStatement instances as mere handles to server side objects.
And indeed, Postgres JDBC users have historically been using
java.sql.PreparedStatements for its side-effect of preventing SQL
injection rather than for the purpose the JDBC API designers had in
mind with this class.

I'm not sure where this hypothesis is coming from. Postgresql server prepared statements can certainly handle parameters.

What makes you think it can't ?

Dave

pgsql-jdbc by date:

Previous
From: Péter Kovács
Date:
Subject: Re: Very strange performance decrease when reusing a PreparedStatement
Next
From: John Lister
Date:
Subject: Re: Very strange performance decrease when reusing a PreparedStatement