Обсуждение: Java Transaction

Поиск
Список
Период
Сортировка

Java Transaction

От
Anil Amarakoon
Дата:
Hi All!

How do I do transaction in Java
when I tried
resultset=statement.executeQuery("begin transaction);
resultset.close();
resultset = statement .executeQuery("select foo from bar where
myid=1000");

it does not return any results.

or do I have to do with
connection.setAutoCommit(false);
bla bla...
myconn.commit();

any information in this regard is highly appreciated.

Tks a lot

Anil


Re: [INTERFACES] Java Transaction

От
Peter T Mount
Дата:
On Wed, 6 May 1998, Anil Amarakoon wrote:

> Hi All!
>
> How do I do transaction in Java
> when I tried
> resultset=statement.executeQuery("begin transaction);
> resultset.close();
> resultset = statement .executeQuery("select foo from bar where
> myid=1000");
>
> it does not return any results.
>
> or do I have to do with
> connection.setAutoCommit(false);
> bla bla...
> myconn.commit();
>
> any information in this regard is highly appreciated.

The JDBC way is using AutoCommit, and the first way may fail in 6.4

--
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk