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

Explain about column name and getter method?

0 Answers  


How to check jdbc connection in java?

0 Answers  


What are the differences between setmaxrows(int) and setfetchsize(int)?

0 Answers  


Is jdbc database independent?

0 Answers  


What is Type-1 Driver and when this driver is used?

3 Answers  






What is the use of jdbc api?

0 Answers  


Can we have foreign key reference to a non primary key column ?

0 Answers  


Explain creation of statement object with connection method create method with help of an example.

0 Answers  


What are the differences between stored procedure and functions?

0 Answers  


What is setautocommit in jdbc?

0 Answers  


What are the advantages of using preparedstatement over statement?

0 Answers  


What is JDBC RowSet? What are different types of RowSet?

0 Answers  


Categories