pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Herbert <Marc.Herbert@continuent.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: PreparedStatement clearParameters
Date: Tue, 21 Feb 2006 11:21:59 +0100
Message-ID: <khj64n9t3js.fsf@meije.emic.fr> (raw)
References: <FD2E9949-0E9B-4C0D-92E7-2AB587DC319B@entelience.com>

Thomas Burdairon <tburdairon@entelience.com> writes:

> But, it seems the clearParameters method remove us all the benefit of
> prepare statements, because the query is sent again on each
> executeQuery/executeUpdate call.

> Then, i don't even know if it's a bug, maybe it's a feature (?)

I have never read anything in the specifications of the JDBC interface
that _guarantees_ anything concerning performance. I only found more
or less fuzzy statements like "it is pre-compiled" (what does that
mean formally? to what extent?) or that "execution can be faster".

The corresponding ODBC documentation is a bit more precise
 <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcprepared_execution.asp;
except it specifically caters for the zero-preparation case:
 
  If the driver cannot emulate statement preparation, it stores the
  statement when SQLPrepare is called and submits it for execution when
  SQLExecute is called.
  Because emulated statement preparation is not perfect, SQLExecute can
  return any errors normally returned by SQLPrepare.

So this definitely look like a feature ;-)

Please correct me when I am wrong.

By the way ODBC does not confuse parametrization and preparation like
JDBC does.





view thread (4+ messages)

Message-ID: <khj64n9t3js.fsf@meije.emic.fr>
Permalink:  ../khj64n9t3js.fsf@meije.emic.fr/
Also on:    postgresql.org/message-id/khj64n9t3js.fsf@meije.emic.fr

 · 

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: Marc.Herbert@continuent.com
  Subject: Re: PreparedStatement clearParameters
  In-Reply-To: <khj64n9t3js.fsf@meije.emic.fr>
  References: <FD2E9949-0E9B-4C0D-92E7-2AB587DC319B@entelience.com> <khj64n9t3js.fsf@meije.emic.fr>

* 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