Suppose that the table animal has five rows and this SQL statement updates all of them.
What is the result of this code?
public static void main(String[] args) throws SQLException { Connection conn = DriverManager.getConnection("jdbc:derby:zoo"); Statement stmt = conn.createStatement(); int result = stmt.executeUpdate("update animal set name = name"); System.out.println(result); }
C.
This code works as expected.
It updates each of the five rows in the table and returns the number of rows updated.
Therefore, choice C is correct.