Answer Posted / ketan
transaction means two or more queries are perform
simultaneously.
1. Hence befor first query put up setAutoCommit(false);
2. now at the end of several queries performed. if you know
how much rows will affect this transaction then you can
compare it with current transaction rows.
3. if both equals then commit() and setAutoCommit to true in
else rollback() and setAutoCommit(true).
4. as well as in catch statement put rollback() and
setAutoCommit(true);
5. and in finally setAutoCommit(true).
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different types of statements? How we can you use preparedstatement.
What is a rollback in jdbc?
What are the main components of JDBC ?
Explain how data flows from view to db and reverse
How to get the Database server details in java program?
Does JDBC support stored procedures?
How can we disable a constraint ?
What is jdbc databasemetadata interface?
Explain the difference between inner and outer join ?
What are the different types of interfaces in the api component?
How do I find jdbc version?
Name the new features added in jdbc 4.0.
what is the meaning of following code snippets Class c=class.forName(driverClassName); Driver d=(driver)c.newInstance();
Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?
What are the factors that the jdbc driver performance depends upon?