Oracle
1Z0-809 · Question #203
1Z0-809 Question #203: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #203. The question stem and answer options stay visible for context.
Question
Given the code fragment: try { Connection conn = DriverManager.getConnection(dbURL, userName, passWord); String query = "SELECT * FROM Employee WHERE ID = 110"; Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery(query); while (rs.next()) System.out.print("Employee ID: " + rs.getInt("ID")); } catch (Exception ee) { System.out.println("Error"); } Assume that: The required database driver is configured in the classpath. The appropriate database is accessible with the dbURL, userName, and passWord exists. The Employee table has a column ID of type integer and the SQL query matches one record. What is the result?
Options
- ACompilation fails at line 14.
- BCompilation fails at line 15.
- CThe code prints the employee ID.
- DThe code prints Error.
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.