• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

commit statement

 
tribhuwan soni
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i use commit statement in update , select and insert querry


regards,

TRIBHUWAN SONI
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Sheriff
Pie
Posts: 48940
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to commit all the time, consider using a transaction which includes "commit" at its end.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to commit all the time, then do not do anything as autocommit is defaulted to true.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48940
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic