JDBC, PgSQL 7.2: transactions not supported!!

Started by Zengfa Gaoover 23 years ago2 messagesgeneral
Jump to latest
#1Zengfa Gao
zfgao@yahoo.com

Hi,

I am using JDBC Driver to access PgSQL 7.2. When I
add:

Statement.executeQuery("BEGIN WORK;");
...
Statement.executeQuery("Insert.........");
...

Statement.executeQuery("COMMIT WORK;");

in the java code.

I got:
transactions not supported!!

According the document of 7.2, transaction is
supported. Does anyone know what's wrong here?

Thanks!

Zengfa

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

#2Barry Lind
barry@xythos.com
In reply to: Zengfa Gao (#1)
Re: JDBC, PgSQL 7.2: transactions not supported!!

Zengfa,

Transactions are supported, you are just doing them incorrectly for
jdbc. In jdbc you turn on transactions by calling
connection.setAutoCommit(false);
and you commit or rollback by calling connection.commit(); or
connection.rollback();

--Barry

Zengfa Gao wrote:

Show quoted text

Hi,

I am using JDBC Driver to access PgSQL 7.2. When I
add:

Statement.executeQuery("BEGIN WORK;");
...
Statement.executeQuery("Insert.........");
...

Statement.executeQuery("COMMIT WORK;");

in the java code.

I got:
transactions not supported!!

According the document of 7.2, transaction is
supported. Does anyone know what's wrong here?

Thanks!

Zengfa

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html