On Tue, 18 Jul 2000, Christoph Schmidt wrote:
>
> where is the point to turn autocommit off ?
You turn it off by calling a method on Connection.
> I am new to PREPARED STATEMENT...
> Where can i find the documentation ?
See the JDBC documentation on Sun's Web site, or any recent Java book.
> How much more efficient is it ?
Unfortunately, with Postgresql PreparedStatement is not more efficient
because Postgresql does not cache queries on the server. The Postgresql
JDBC driver must expand the '?' placeholders on the client-side and send
the complete query to the backend.
Even without the performance advantage, PreparedStatement can be more
convenient because it adds some value. For example, when a '?' is replaced
by a string using setString() the driver will escape any single quotes
that may be contained in the string. If you construct the query yourself
it is your responsibility to get this right.
Joachim