jdbc: Batch updates-Prepared Statements

Поиск
Список
Период
Сортировка
От Alexaki Sofia
Тема jdbc: Batch updates-Prepared Statements
Дата
Msg-id Pine.GSO.4.10.10105281110250.18361-100000@sappho.ics.forth.gr
обсуждение исходный текст
Список pgsql-interfaces
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



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Joe Conway"
Дата:
Сообщение: remote database queries
Следующее
От: Hans-Jürgen Schönig
Дата:
Сообщение: ECPG error: break statement not within loop or switch