nerdexam
Oracle

1Z0-809 · Question #28

Given the records from the Employee table: eid ename 111 Tom 112 Jerry 113 Donald and given the code fragment: try { Connection conn = DriverManager.getConnection(URL, userName, passWord); Statement…

The correct answer is C. The Employee table is NOT updated and the program prints: 112 Jerry. You've hit your session limit · resets 5:20pm (America/New_York)

Question

Given the records from the Employee table: eid ename 111 Tom 112 Jerry 113 Donald and given the code fragment: try { Connection conn = DriverManager.getConnection(URL, userName, passWord); Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); st.execute("SELECT*FROM Employee"); ResultSet rs = st.getResultSet(); while (rs.next()) { if (rs.getInt(1) ==112) { rs.updateString(2, "Jack"); } } rs.absolute(3); System.out.println(rs.getInt(1) + " " + rs.getString(2)); } catch (SQLException ex) { System.out.println("Exception is raised"); } Assume that:
  • The required database driver is configured in the classpath.
  • The appropriate database is accessible with the URL, username, and password exists. What is the result?

Options

  • AThe Employee table is updated with the row: 112 Jack and the program prints: 112 Jerry
  • BThe Employee table is updated with the row: 112 Jack and the program prints: 112 Jack
  • CThe Employee table is NOT updated and the program prints: 112 Jerry
  • DThe program prints Exception is raised.

How the community answered

(49 responses)
  • A
    4% (2)
  • B
    14% (7)
  • C
    73% (36)
  • D
    8% (4)

Explanation

You've hit your session limit · resets 5:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice