Find the error in the following Java code. Assume that conn references a valid Connection object. //

Question:

Find the error in the following Java code. Assume that conn references a valid Connection object.

// This code has an error!!!
String sql = "SELECT * FROM Coffee";
Statement stmt = conn.createStatement();
ResultSet result = stmt.execute(sql);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: