public void testUpdate6(){
  String updateQuery="UPDATE " + DatabaseCreator.TEST_TABLE1 + " SET field2='1'";
  try {
    int num=statement.executeUpdate(updateQuery);
    assertEquals("Not all records in the database were updated",numberOfRecords,num);
    String selectQuery="SELECT field2 FROM " + DatabaseCreator.TEST_TABLE1;
    ResultSet result=statement.executeQuery(selectQuery);
    result.close();
  }
 catch (  SQLException e) {
    fail("Unexpected exception" + e.getMessage());
  }
}

public void testUpdate6 ( ) { String updateQuery = "UPDATE " + DatabaseCreator . TEST_TABLE1 + " SET field2='1'" ; try { int num = statement . executeUpdate ( updateQuery ) ; assertEquals ( "Not all records in the database were updated" , numberOfRecords , num ) ; String selectQuery = "SELECT field2 FROM " + DatabaseCreator . TEST_TABLE1 ; ResultSet result = statement . executeQuery ( selectQuery ) ; result . close ( ) ; } catch ( SQLException e ) { fail ( "Unexpected exception" + e . getMessage ( ) ) ; } }
updatefunctionalitytest # testupdate6 ( ) . sets value of field2 to default
