Received: from priv-edtnes12-hme0.telusplanet.net (edtnes12.telus.net [199.185.220.112]) by hub.org (8.10.1/8.10.1) with ESMTP id e6IK0Eh90625 for ; Tue, 18 Jul 2000 16:00:14 -0400 (EDT) Received: from VAN4 ([216.232.28.37]) by priv-edtnes12-hme0.telusplanet.net (InterMail vM.4.01.02.11 201-229-116-111) with ESMTP id <20000718200013.GPAL7614.priv-edtnes12-hme0.telusplanet.net@VAN4> for ; Tue, 18 Jul 2000 14:00:13 -0600 Date: Tue, 18 Jul 2000 12:57:16 -0700 (Pacific Daylight Time) From: Joachim Achtzehnter To: pgsql-interfaces@postgresql.org Subject: Re: Connection.setBytes() In-Reply-To: <00071821334800.00719@nasen2> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200007/129 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