We have 4 stored procedures which we are using to insert the entries in database, These 4 are interdependent, If any of this fails Whole operation has to be rolled back, only if everything goes well I want to commit the transaction. How do I achieve that.
Thanks,
Rohit.
You need to use JDBC’s transaction support, which is described in the JDBC Tutorial here.
Pseudo-code:
Plus all the usual closing of connections, statements, etc.
The link describes the specifics.