Oracle
1Z0-804 · Question #157
1Z0-804 Question #157: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-804 to reveal the answer and full explanation for question #157. The question stem and answer options stay visible for context.
Question
Given the code fragment: try { String query = "SELECT * FROM Employee WHERE ID=110"; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(query); // Line 13 System.out.println("Employee ID: " + rs.getInt("ID")); // Line 14 } catch (Exception se) { System.out.println("Error"); } Assume that the SQL query matches one record. What is the result of compiling and executing this code?
Options
- AThe code prints error.
- BThe code prints the employee ID.
- CCompilation fails due to an error at line 13.
- DCompilation fails due to an error at line 14.
Unlock 1Z0-804 to see the answer
You've previewed enough free 1Z0-804 questions. Unlock 1Z0-804 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.