Q71 From https://www.examtopics.com/exams/oracle/1z0-809/view/15/ :
Given the records from the Employee table:
and given the code fragment:
The required database driver is configured in the classpath.
The appropriate database accessible with the URL, userName, and passWord exists.
What is the result?
A. The Employee table is updated with the row: 112 Jack and the program prints: 112 Jerry
B. The Employee table is updated with the row: 112 Jack and the program prints: 112 Jack
C. The Employee table is not updated and the program prints: 112 Jerry
D. The program prints Exception is raised.
My understanding is that:
1. rs.updateXXX(colName, newValue) //update columns IN ResultSet 2. Call rs.updateRow(); //to update IN db with (ResultSet updates commited to db…)
and here, although we are in TYPE_SCROLL_INSENSITIVE mode - that is to do with the db being changed by other means e.g. through different ResultSets,
here, we are updating the same ResultSet, so any updates to rows should be visible.
From this, the answer should therefore be:
The Employee table is not updated and the program prints: 112 Jack (table not updated because rs.updateRow() was never called, but "Jack" because of 1.^)
which is not an option...
Can someone confirm if my understanding is correct and that the answers A/B/C/D are wrong?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop