JDBC Transaction
In a Database Server , a transaction is a sequence of operations. Those operations are considered to be a single unit of work which either finish all or nothing , that is a transaction is atomic either lives or never exists. For example you when your customer make a payment , you insert that payment into the payment table and update customer's balance in the customer table. If your update failse after the insert, you have to delete the payment to retry the operation. To avoid this we use transctions: begin; insert into customer_payment values(100,now(),12.0); update customer set balance = balance+12.0 where customer_id = 100"; commit; or something got wrong rollback; These two sql statements above will take affect into tables when you commit, if you rollback there will be no effect no update and no insert. By default , every database in JDBC commits automatically. If you want to make use of transactions , you have to turn autocommit off. Be caref...