Saubhagya Srivastava Saubhagya Srivastava -4 years ago 63
SQL Question

Auto Commit In JDBC (Java)

I just tried JDBC and figured out that auto-commit is enable in java but not in SQL-Command line it means that if I execute a 3 queries (say), and second one is wrong syntax wise the first once executes and flow of program breaks after that how to clean the first memory out of the local buffer in that case?

Answer Source

You could use any of below depending on your requirements :

conn.setAutoCommit(false); // set False to disable auto-commit

conn.rollback( ); // to Rollback previous transaction

You can also refer Using Transactions

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download