nerdexam
Oracle

1Z0-809 · Question #88

1Z0-809 Question #88: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #88. The question stem and answer options stay visible for context.

Question

Given the code fragment: 9. Connection conn = DriverManager.getConnection (dbURL, userName, password); 10. String query = "SELECT id FROM Employee"; 11. try (Statement stmt = conn.createStatement()) { 12. ResultSet rs = stmt.executeQuery(query); 13. rs = stmt.executeQuery("SELECT id FROM Customer"); 14. while (rs.next()) { 15. //process the results 16. System.out.println("Employee ID: " + rs.getInt("id")); 17. } } catch (Exception e) { 18. System.out.println ("Error"); 19. } 20. } 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 and Customer tables are available and each table has id column with a few records and the SQL queries are valid. What is the result of compiling and executing this code fragment?

Options

  • AThe program prints employee IDs.
  • BThe program prints customer IDs.
  • CThe program prints Exception.
  • Dcompilation fails on line 13.

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.

Full 1Z0-809 Practice