Updating a Row of Data in a Database Table This example updates a row in a table called ``mytable''. In particular, for all rows whose column COL_B equals 123, column COL_A is set to ``John Doe''. try { Statement stmt = connection.createStatement(); int numUpdated = stmt.executeUpdate( "UPDATE mytable SET COL_A = 'John Doe' WHERE COL_B = 123"); connection.close(); } catch (SQLException e) { }