Consider this program and choose the best option describing its behavior (assume that the connection is valid):
try (Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery("SELECT * FROM contact")){ System.out.println(resultSet.getInt("id") + "\t" + resultSet.getString("firstName") + "\t" + resultSet.getString("lastName") + "\t" + resultSet.getString("email") + "\t" + resultSet.getString("phoneNo")); } catch (SQLException sqle) { System.out.println("SQLException"); }
A.
The statement while (resultSet.next()
) is missing.