[B]Hi there
I am using several insert statements in a method in Java.
If the connection fails in between I want to roll back the inserted rows.
I cant use con.rollback(), because there is no connection.
How to handle such situation?
Thanks in advance.[/B]

Recommended Answers

All 2 Replies

Have you tried setting the autocommit to false. If you don't even if you had the connection, the rollback wouldn't work.

Have you tried setting the autocommit to false. If you don't even if you had the connection, the rollback wouldn't work.

Thank a lot for your answer.:)
That is what i was missing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.