How transactions are performed using JDBC ?

Answers were Sorted based on User's Feedback



How transactions are performed using JDBC ?..

Answer / devarathnam c,kotagudibanda(po

Hi... Using the following methods we can perform
transactions in JDBC
1:commit();
2:rollback();
3:setAutoCommit();These are in the Connection interface

Is This Answer Correct ?    4 Yes 0 No

How transactions are performed using JDBC ?..

Answer / 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

More JDBC Interview Questions

Is oracle client required for jdbc connection?

0 Answers  


What are the packages are used in jdbc?

0 Answers  


Explain the sequence of steps to connect to the database?

3 Answers   Wipro,


How transactions are performed using JDBC ?

2 Answers  


can we define indexes on a foreign key? Explain pros and cons?

1 Answers  






List the common jdbc exceptions ?

0 Answers  


Why prepared statements are faster?

0 Answers  


What is a jdbc connection?

0 Answers  


Which is better jpa or jdbc?

0 Answers  


What is the difference between jdbc and odbc?

0 Answers  


Explain different types of locks in jdbc?

0 Answers  


Can I use JDBC to execute non-standard features that my DBMS provides?

0 Answers  


Categories