MCQ: Which of the following interface provides the commit() and rollback() methods?



Which of the following interface provides the commit() and rollback() methods?

  1. Statement Interface
  2. ResultSet Interface
  3. Connection Interface
  4. RowSet Interface

Answer

c. Connection Interface

Explanation:

The Connection interface provides the commit() and rollback() method. 

The commit() method makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. 

The rollback() method undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.

Free Spring Boot Tutorial - 5 Hours Full Course


Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course

Comments