Assume that the following code is used to retrieve data from the CoffeeDB databases Coffee table. Write
Question:
Assume that the following code is used to retrieve data from the CoffeeDB database’s Coffee table. Write the code that should appear inside the loop to display the contents of the result set.
String sql = "SELECT * FROM Coffee";
Connection conn = DriverManager.getConnection(DB_URL);
Statement stmt = conn.createStatement();
ResultSet result = stmt.executeQuery(sql);
while (result.next())
{
// Finish this code!!
}
Stmt.close();
Conn.close();
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Question Posted: