This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
as per jdbc spec 3.0 a transaction for a jdbc driver is a single sql statement. but what if one wants application level transaction, i.e suppose i want:
transaction begin: select a select b update c update d delete e transaction end.
i want to create such transactions which span beyond a single sql statement, i.e are a combination of multiple sql statements. i want to implement such transactions in servlets. i take a connection from a connection pool via DataSource object(on weblogic server). then should i set auto commit to false, carry out the sql statements, and commit. is this the right approach or is it that in weblogic, every single connection from the connection pool forms a single transaction?
What you have specified is one way of handling transaction. If you don't need distributed transactions, you can manage with con.setAutoCommit(false), con.rollback() & con.commit(). Only if you need distributed transactions you should worry about using JTA.