nerdexam
Oracle

1Z0-805 · Question #2

1Z0-805 Question #2: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #2. 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-805 to see the answer

You've previewed enough free 1Z0-805 questions. Unlock 1Z0-805 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.

Full 1Z0-805 Practice