Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 1z0-809 topic 1 question 171 discussion

Actual exam question from Oracle's 1z0-809
Question #: 171
Topic #: 1
[All 1z0-809 Questions]

Given records from the Player table:
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");
st.setMaxRows(2);
ResultSet rs = st.getResultSet();
rs.absolute(3);
while (rs.next ()) {
System.out.println(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?

  • A. 2 Jack 3 Sam
  • B. The program prints nothing.
  • C. 3 Sam
  • D. SQLException is thrown.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
jduarte
Highly Voted 3 years, 3 months ago
Answer D. Tested. rs.absolute(3); move to the rows 3 and no exist
upvoted 10 times
...
shivkumarx
Most Recent 2 weeks, 3 days ago
Selected Answer: B
Answer is B, no exception was thrown
upvoted 1 times
...
iSnover
2 months, 4 weeks ago
Selected Answer: D
Answer D. Tested. rs.absolute(3); move to the rows 3 and no exist
upvoted 1 times
...
steefaand
2 months, 4 weeks ago
Selected Answer: B
It should be B as rs.absolute(3) will just return false and it shouldn't throw exception.
upvoted 1 times
...
Huim
2 years, 11 months ago
Answer ist B.
upvoted 2 times
...
Huim
2 years, 11 months ago
Answer is B. Prints nothing.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...