How transactions are performed using JDBC ?
Answers were Sorted based on User's Feedback
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 |
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 |
How do find debugging problems related to JDBC API?
How can you make the connection using jdbc?
what is JDBC?
How do I receive a ResultSet from a stored procedure?
How do I disallow NULL values in a table?
what are the types of result sets in JDBC 3.0 ?
Why do I have to reaccess the database for Array, Blob, and Clob data?
Where jdbc drivermanager class is used?
What is de-normalization?
What is a jdbc connection string?
what is the best way, in terms of performance, to do multiple insert/update statements, a PreparedStatement or Batch Updates?
Why resultset is used in java?