Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 2 Question 64 Discussion

Actual exam question for Oracle's 1Z0-809 exam
Question #: 64
Topic #: 2
[All 1Z0-809 Questions]

Given the code fragment:

9. Connection conn = DriveManager.getConnection(dbURL, userName, passWord);

10. String query = ''SELECT id FROM Employee'';

11. try (Statement stmt = conn.createStatement()) {

12. ResultSet rs = stmt.executeQuery(query);

13.stmt.executeQuery(''SELECT id FROM Customer'');

14. while (rs.next()) {

15. //process the results

16.System.out.println(''Employee ID: ''+ rs.getInt(''id''));

17.}

18. } catch (Exception e) {

19. System.out.println (''Error'');

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?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Malcom
4 days ago
The program prints employee IDs. The code first executes the query 'SELECT id FROM Employee' and processes the results, which is what the question is asking about.
upvoted 0 times
...
Estrella
22 days ago
I believe the correct answer is A) The program prints employee IDs.
upvoted 0 times
...
Gail
24 days ago
I agree with Gregoria, the code is querying the Employee table.
upvoted 0 times
...
Gregoria
29 days ago
I think the program will print employee IDs.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77