Oracle
1Z0-809 · Question #245
1Z0-809 Question #245: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #245. The question stem and answer options stay visible for context.
Question
Given the records from the STUDENT table:
sid sname semail
111 James [email protected]
112 Jane [email protected]
114 John [email protected]
Given the code fragment:
public static void main(String[] args) throws SQLException {
//code to load and register valid JDBC Driver
Connection con = DriverManager.getConnection(URL, username, password);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM student");
ResultSetMetaData rsmd = rs.getMetaData();
rs.absolute(3);
rs.updateString(2, "Jannet");
rs.updateString(3, "[email protected]");
rs.updateRow();
rs.refreshRow();
System.out.println(rs.getInt(1) + " : " + rs.getString(2) + " : " + rs.getString(3));
}
Assume that the URL, username, and password are valid.
What is the result?
Options
- AThe STUDENT table is not updated and the program prints: 114 : john : [email protected]
- BThe STUDENT table is updated with the record: 113 : Jannet : [email protected] and the program prints: 114 : john : [email protected]
- CThe STUDENT table is updated with the record: 113 : Jannet : [email protected] and the program prints: 113 : Jannet : [email protected]
- DA SQLException is thrown at run time.
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.