nerdexam
Oracle

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…

Building Database Applications with JDBC

Question

Given the code fragment:

What is the result of the employees table has no records before the code executed?

Exhibit

1Z0-804 question #68 exhibit

Options

  • A1 Sam
  • B4 Jack
  • C3 John
  • D1 Sam

How the community answered

(40 responses)
  • A
    15% (6)
  • B
    10% (4)
  • C
    73% (29)
  • D
    3% (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

#Statement#ResultSet scrolling#JDBC insert#auto-commit

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice