Kris Jurka <books@ejurka.com> writes:
>> That's peculiar. The whole point of prepared statements is to obtain
>> the optimization of statement reuse.
>
> Sometimes it is, sometimes the purpose of using a PreparedStatement is
> to avoid escaping data yourself for a plain Statement execution.
By the way this confusion has been introduced by JDBC. In ODBC the
functions SQLBindParameter() and SQLPrepare() were not related.
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcbinding_parameter_markers.asp>
Both ODBC and JDBC docs warn the user that some drivers may not fully
implement PREPARE. Exercise: define "fully" in a portable way.
Granted, you can still complain if PREPARE does nothing at all.
I remember a number of past discussions on this topic. Among others
this one: "Subject: Limit vs setMaxRows issue"
<http://archives.postgresql.org/pgsql-jdbc/2006-07/threads.php#00020>