Online Access Free 1Z1-805 Exam Questions
| Exam Code: | 1Z1-805 |
| Exam Name: | Upgrade to Java SE 7 Programmer |
| Certification Provider: | Oracle |
| Free Question Number: | 90 |
| Posted: | Oct 04, 2026 |
Given the code fragment:
try {
String query = "SELECT * FROM Employee WHERE ID=110";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query); // Line 13
System.out.println("Employee ID: " + rs.getInt("ID")); // Line 14
} catch (Exception se) {
System.out.println("Error");
}
Assume that the SQL query matches one record. What is the result of compiling and executing this code?
Given this code fragment:
try {
String query = "SELECT * FROM Item";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
int rowCount = rsmd.getRowCount();
System.out.println ("Processing: " + rowCount + " rows.");
while (rs.next()) {
// Process each row
}
} catch (SQLException se) {
System.out.println("Error");
}
Assume that the SQL query returns records. What is the result?