Oracle
1Z0-809 · Question #245
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…
The correct answer is A. The STUDENT table is not updated and the program prints: 114 : john : [email protected]. You've hit your session limit · resets 5:20pm (America/New_York)
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.
How the community answered
(18 responses)- A72% (13)
- B6% (1)
- C17% (3)
- D6% (1)
Explanation
You've hit your session limit · resets 5:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.