Re: Connection.setBytes() - Mailing list pgsql-interfaces

From Joachim Achtzehnter
Subject Re: Connection.setBytes()
Date
Msg-id Pine.WNT.4.21.0007181248340.131-100000@van4
Whole thread Raw
In response to Re: Connection.setBytes()  (ChristophSchmidt <cs.hilzingen@swol.de>)
List pgsql-interfaces
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



pgsql-interfaces by date:

Previous
From: Joachim Achtzehnter
Date:
Subject: Re: Connection.setBytes()
Next
From: Matt Fair
Date:
Subject: Re: Connection.setBytes()