From: Joachim Achtzehnter <joachim@kraut.bc.ca>
To: pgsql-interfaces@postgresql.org
Subject: Re: Connection.setBytes()
Date: Tue, 18 Jul 2000 12:57:16 -0700 (Pacific Daylight Time)
Message-ID: <Pine.WNT.4.21.0007181248340.131-100000@van4> (raw)
In-Reply-To: <00071821334800.00719@nasen2>
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
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-interfaces@postgresql.org
Cc: joachim@kraut.bc.ca
Subject: Re: Connection.setBytes()
In-Reply-To: <Pine.WNT.4.21.0007181248340.131-100000@van4>
References: <00071821334800.00719@nasen2> <Pine.WNT.4.21.0007181248340.131-100000@van4>
* 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