aspose file tools
The moose likes JDBC and Relational Databases and the fly likes commit statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "commit statement" Watch "commit statement" New topic
Author

commit statement

tribhuwan soni
Greenhorn

Joined: May 23, 2007
Posts: 6
can i use commit statement in update , select and insert querry


regards,

TRIBHUWAN SONI
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2541
    
  10

Tribhuwan,


Commit applies your update, insert or delete transactions to the database,
and makes these transactions available for all users.
In the most simple form, if you want to use transactions in JDBC:
You turn off your connection's auto commit functionality.
You perform your update queries (update, insert delete).
You do a commit by calling your database connection's commit().

Regards, Jan


OCUP UML fundamental and ITIL foundation
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43308
    
  32
If you are going to commit all the time, consider using a transaction which includes "commit" at its end.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
If you are going to commit all the time, then do not do anything as autocommit is defaulted to true.


Rahul Bhattacharjee
LinkedIn - Blog
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43308
    
  32
Originally posted by Rahul Bhattacharjee:
If you are going to commit all the time, then do not do anything as autocommit is defaulted to true.
Yes, I forgot that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: commit statement
 
It's not a secret anymore!