Oracle
1Z0-809 · Question #262
1Z0-809 Question #262: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #262. The question stem and answer options stay visible for context.
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.
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.