This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes doing transaction using jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "doing transaction using jdbc" Watch "doing transaction using jdbc" New topic

doing transaction using jdbc

Vijji, Thomas

Joined: Jun 16, 2001
Posts: 1
In my program the trancaction gets closed after an insert . It is not wating for commit or rollback to finish the transaction.
Urgent help required

SeE Consulting (P) Ltd<BR>New Delhi
Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
I believe that the default is for auto-commit is true.
setAutoCommit must be false, and then you can use commit.
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
When a connection is created, it is in auto-commit mode. This means that each individual SQL statement is treated as a transaction and will be automatically committed right after it is executed.
The last thing you can try is disable auto-commit mode and then commit the transaction. Later you can enable the auto commit mode.
// your
// SQL statements
// will go here

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: doing transaction using jdbc
It's not a secret anymore!