Re: PreparedStatement clearParameters

Поиск
Список
Период
Сортировка
От Marc Herbert
Тема Re: PreparedStatement clearParameters
Дата
Msg-id khj64n9t3js.fsf@meije.emic.fr
обсуждение исходный текст
Ответ на PreparedStatement clearParameters  (Thomas Burdairon <tburdairon@entelience.com>)
Список pgsql-jdbc
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.


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: David Goodenough
Дата:
Сообщение: Re: setString and timestamps
Следующее
От: David Gommeren
Дата:
Сообщение: getPrimaryKeys