Skip site navigation (1) Skip section navigation (2)

jdbc: Batch updates-Prepared Statements

From: Alexaki Sofia <alexaki(at)ics(dot)forth(dot)gr>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: peter(at)retep(dot)org(dot)uk
Subject: jdbc: Batch updates-Prepared Statements
Date: 2001-05-28 08:42:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

At postgresql JDBC driver a Statement.executeBatch() command 
is equivalent to a transaction containing the update commands of the
batch. I think this is not compatible with java  jdbc documentation 
where states that when 
 an Statement.executeBatch() command is executed the batch of commands
are executed but no in a new transaction. If you want to  create a new
transaction you have to state it explicitly. That is you should turn off
autocommit and finally execute the Connection.commit command.

According to current implementation I can't have multiple 
Statement.executeBatch() commands in one transaction.
I also want to ask whether in postgresql JBDC driver 'Prepared statements'
are more efficient than 'Statements'. 

thank you in advance.

Sofia Alexaki

pgsql-interfaces by date

Next:From: Ludek FinstrleDate: 2001-05-28 16:14:15
Subject: Re: Re: ODBC Security
Previous:From: Joe ConwayDate: 2001-05-28 05:02:17
Subject: remote database queries

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group