Re: Very strange performance decrease when reusing a PreparedStatement

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Péter Kovács <maxottovonstirlitz(at)gmail(dot)com>
Cc: Frédérik Bilhaut <frederik(dot)bilhaut(at)noopsis(dot)fr>, Oliver Jowett <oliver(at)opencloud(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Very strange performance decrease when reusing a PreparedStatement
Date: 2009-05-03 10:10:41
Message-ID: 491f66a50905030310j5b4cdcd8jbf4f6e757c2ba580@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Lister 2009-05-03 10:35:47 Re: Very strange performance decrease when reusing a PreparedStatement
Previous Message Péter Kovács 2009-05-03 08:22:42 Re: Very strange performance decrease when reusing a PreparedStatement