1Z0-804 · Question #68
Given the code fragment: What is the result of the employees table has no records before the code executed?
The correct answer is C. 3 John. AutoCommit is set to false. The two following statements will be within the same transaction. stmt.executeUpdate("insert into employees values(1,'Sam')"); stmt.executeUpdate("insert into employees values(2,'Jane')"); These two statements are rolled-back through (the savepoint…
Question
Given the code fragment:
What is the result of the employees table has no records before the code executed?
Exhibit
Options
- A1 Sam
- B4 Jack
- C3 John
- D1 Sam
How the community answered
(40 responses)- A15% (6)
- B10% (4)
- C73% (29)
- D3% (1)
Explanation
AutoCommit is set to false. The two following statements will be within the same transaction. stmt.executeUpdate("insert into employees values(1,'Sam')"); stmt.executeUpdate("insert into employees values(2,'Jane')"); These two statements are rolled-back through (the savepoint is ignored! the savepoint must be conn.rollback(save1); ) in the rollback if you want to rollback to the savepoint): conn.rollback() ; The next two insert statements are executed fine. Their result will be in the output.
Topics
Community Discussion
No community discussion yet for this question.
