Oracle
1Z0-804 · Question #18
1Z0-804 Question #18: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-804 to reveal the answer and full explanation for question #18. The question stem and answer options stay visible for context.
Question
Given the code fragment: String query = "SELECT ID FROM Employee"; \ Line 1 try (Statement stmt = conn.CreateStatement()) { \ Line 2 ResultSet rs = stmt.executeQuery(query); \ Line 3 stmt.executeQuery ("SELECT ID FROM Customer"); \ Line 4 while (rs.next()) { \process the results System.out.println ("Employee ID: " + rs.getInt("ID") ); } } catch (Exception e) { system.out.println ("Error"); } Assume that the SQL queries return records. What is the result of compiling and executing this code fragment?
Options
- AThe program prints employees IDs.
- BThe program prints customer IDs.
- CThe program prints Error.
- DCompilation fails on line 13.
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.