What is the result of compiling and executing this code fragment?

Given the code fragment:


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?
A. The program prints employee IDs.
B. The program prints customer IDs.
C. The program prints Error.
D. compilation fails on line 13.

Download Printable PDF. VALID exam to help you PASS.

7 thoughts on “What is the result of compiling and executing this code fragment?

  1. Corect answer is C. Error is: Operation not allowed after ResultSet closed.
    Because after executing the second query, the first one is automatically closed.
    This is also written in the official doc.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.