pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexaki Sofia <alexaki@ics.forth.gr>
To: pgsql-interfaces@postgresql.org
Cc: peter@retep.org.uk
Subject: jdbc: Batch updates-Prepared Statements
Date: Mon, 28 May 2001 11:42:19 +0300 (EEST)
Message-ID: <Pine.GSO.4.10.10105281110250.18361-100000@sappho.ics.forth.gr> (raw)

Hello,

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.

Regards,
Sofia Alexaki




Message-ID: <Pine.GSO.4.10.10105281110250.18361-100000@sappho.ics.forth.gr>
Permalink:  ../Pine.GSO.4.10.10105281110250.18361-100000@sappho.ics.forth.gr/
Also on:    postgresql.org/message-id/Pine.GSO.4.10.10105281110250.18361-100000@sappho.ics.forth.gr

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: alexaki@ics.forth.gr, peter@retep.org.uk
  Subject: Re: jdbc: Batch updates-Prepared Statements
  In-Reply-To: <Pine.GSO.4.10.10105281110250.18361-100000@sappho.ics.forth.gr>

* 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