nerdexam
Oracle

1Z0-809 · Question #262

Given records from the Player table: PID PName 1 Dave 2 Jack 3 Sam and given the code fragment: try { Connection conn = DriverManager.getConnection(URL, username, password); Statement st=…

The correct answer is D. SQLException is thrown. You've hit your session limit · resets 5:20pm (America/New_York)

Question

Given records from the Player table: PID PName 1 Dave 2 Jack 3 Sam and given the code fragment: try { Connection conn = DriverManager.getConnection(URL, username, password); Statement st= conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); st.execute("SELECT * FROM Player"); ResultSet rs = st.getResultSet(); rs.absolute(3); while (rs.next()) { System.out.print(rs.getInt(1) + " " + rs.getString(2)); } } catch (SQLException ex) { System.out.print("SQLException is thrown."); } Assume that: The required database driver is configured in the classpath. The appropriate database is accessible with URL, username, and password. The SQL query is valid. What is the result?

Options

  • A2 Jack
  • B3 Sam
  • CThe program prints nothing.
  • DSQLException is thrown.

How the community answered

(32 responses)
  • A
    16% (5)
  • B
    9% (3)
  • C
    3% (1)
  • D
    72% (23)

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