What is the purpose of setAutoCommit( )

Showing Answers 1 - 27 of 27 Answers

jagadeesh Kumar

  • Apr 28th, 2005
 

It is set as  
ConnectionObject.setAutoComit(); 
after any updates through the program cannot be effected to the database.We have commit the transctions .For this puprpose we can set AutoCommit flag to Connection Object.

  Was this answer useful?  Yes

Manikandan Ravi

  • May 25th, 2005
 

After each transaction the daas need to be commied tto the DB. When auto commit is set to true the data s are automatically commied.When u dodnt do this ie set the boolean to false, u need to make a commit statement call at the end of each transaction to get ur data commited.

  Was this answer useful?  Yes

Murugesan surandai

  • Jun 14th, 2005
 

All the database transaction should be committed automatically by JDBC...JDBC takes default commit mode as true....true means transactions committed automatically.[you cannot roll back any database transaction]...false means you can manipulate transaction yourself.

  Was this answer useful?  Yes

Arundathi

  • Jun 30th, 2005
 

To perform a transaction that uses multiple statements, you have to call the setAutoCommit() wiht a false[/I] argument. (u can check the status of autoCommit with the getAutoCommit() method.) Now you can execute the SQL Statements that comprise your transaction. When u r done, u call the commit() method to commit the traaction or the rollbcak() method to undo it.

  Was this answer useful?  Yes

Suni Gulia

  • Jul 3rd, 2005
 

setAutoCommit() set the state fo the Commit in the databse we use setAutoCommit() in bacth updation when we r to execute more then one statemnt togeter, In that case it reduce the databse call and send all statement as batch in one go.setAutoCommit() allowed us to commit the transection commit state mannually By defauly setAutoCommit() is true.

  Was this answer useful?  Yes

Srihari Gouru

  • Jul 13th, 2005
 

Very Useful method of Connection interface in implementing trasactions. Sets the connection's auto-commit mode to the given state. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback.

  Was this answer useful?  Yes

Irphan Ahmed

  • Jul 14th, 2005
 

if you dont use setAutoCommit() method, by default SQL Connection commits to the database after executing each statement. 
if you use setAutoCommit(false) then this method sets the auto comit to false.

  Was this answer useful?  Yes

Jaime

  • Jul 16th, 2005
 

Auto-commit mode indicates to the database whether to issue an automatic COMMIT operation after every SQL operation. Being in auto-commit mode can be expensive in terms of time and processing effort if, for example, you are repeating the same statement with different bind variables. 
 
By default, new connection objects are in auto-commit mode. However, you can disable auto-commit mode with the setAutoCommit() method of the connection object (either java.sql.Conection or oracle.jdbc.OracleConnection). 
 
In auto-commit mode, the COMMIT operation occurs either when the statement completes or the next execute occurs, whichever comes first. In the case of statements returning a ResultSet, the statement completes when the last row of the ResultSet has been retrieved or when the ResultSet has been closed. In more complex cases, a single statement can return multiple results as well as output parameter values. Here, the COMMIT occurs when all results and output parameter values have been retrieved. 
 
If you disable auto-commit mode with a setAutoCommit(false) call, then you must manually commit or roll back groups of operations using the commit() or rollback() method of the connection object.

D.sangeetha

  • Jul 26th, 2005
 

for set the commit in oralce here we use setautocommit()

  Was this answer useful?  Yes

palkumar

  • Sep 4th, 2005
 

please send me all java(core),jdbc,servlets,jsp,struts,jms question with answers please please please

  Was this answer useful?  Yes

noman khan

  • Aug 1st, 2005
 

This method allows to combine more than one operation on database as a single unit. 
When this is set to false, after successful completion it is commit by developers statement. If there is some problem in between then whole unit is rollbacked.

  Was this answer useful?  Yes

Oleti Prasad

  • Aug 4th, 2005
 

This method is used to disable or enable auto committing of database transactions used for data manipulation such as insert, update and delete.

  Was this answer useful?  Yes

neelu

  • Aug 5th, 2005
 

When we want to make a set of transations to be commited or rolled back 
we need to set setAutoCommit() as false

  Was this answer useful?  Yes

Vijayan

  • Sep 1st, 2005
 

setAutoCommit() will help you do transaction with out commit immediately

  Was this answer useful?  Yes

sreedhar

  • Sep 9th, 2005
 

It is used the Sql needs to commit evrytime some trans. is done, by setting it in auto commit it will do the job by itself

  Was this answer useful?  Yes

Yogesh Nagar

  • Sep 11th, 2005
 

The Purpose of setAutoCommit() is to automatically Commit the Transaction processed on the Database.

  Was this answer useful?  Yes

Debojit Deb

  • Sep 11th, 2005
 

The method is used to determine whether any transaction made by executeUpdate() to be saved into the database. By default, status is true, i.e.,  transacations are saved. By setting autocommit to false using setAutocommit(false) you ask the JDBC engine to save the transcation only when you use commit().

  Was this answer useful?  Yes

trekker

  • Apr 20th, 2006
 

its a testing from my side to check out the functionality of the discussion forum that i m building using asp.

  Was this answer useful?  Yes

Sets this connection's auto-commit mode. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode. The commit occurs when the statement completes or the next execute occurs, whichever comes first. In the case of statements returning a ResultSet, the statement completes when the last row of the ResultSet has been retrieved or the ResultSet has been closed. In advanced cases, a single statement may return multiple results as well as output parameter values. In these cases the commit occurs when all results and output parameter values have been retrieved.

  Was this answer useful?  Yes

dkiranmai

  • Nov 21st, 2008
 

If a connection is in auto-commit mode, then all its SQL statements are run and commited as individual transactions. Otherwise, its SQL statements are grouped into transactions that are ended by a call to either the commit method or the rollback method. By default, new connections are in auto-commit mode.

public void setAutoCommit(boolean value)

value: true to enable auto-commit mode for the connection, false to disable it.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions