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.
dbURL, userName, and passWord exists.
The appropriate database is accessible with the
Employee and Customer tables are available and each table has id column with a few records and the SQL queries are valid.
The -
What is the result of compiling and executing this code fragment?
M_Jawad
Highly Voted 4 years, 6 months agoasdfjhfgjuaDCV
Most Recent 4 months, 3 weeks agosteefaand
5 months, 3 weeks agoiSnover
5 months, 3 weeks agoWilsonKKerll
2 years, 4 months agoUchiha
2 years, 4 months agomevlt
2 years, 4 months agomevlt
2 years, 4 months agoadnano1234
4 years, 6 months agoadnano1234
4 years, 6 months ago