code: public static void checkedUpdate (
          Statement stmt, String query, int expectedCount)
          throws SQLException, PersistenceException
      {
          int modified = stmt.executeUpdate(query);
          if (modified != expectedCount) {
              String err = "Statement did not modify expected number of rows [stmt=" + stmt +
                  ", expected=" + expectedCount + ", modified=" + modified + "]";
              throw new PersistenceException(err);
          }
      }
docs: Calls <code>stmt.executeUpdate()</code> on the supplied statement with the supplied query,
  checking to see that it returns the expected update count and throwing a persistence
  exception if it does not.