public void testUpdate5(){
  int factor=3;
  String updateQuery="UPDATE " + DatabaseCreator.TEST_TABLE1 + " SET field2=field2 *"+ factor;
  try {
    String selectQuery="SELECT field2 FROM " + DatabaseCreator.TEST_TABLE1;
    ResultSet result=statement.executeQuery(selectQuery);
    HashSet<BigDecimal> values=new HashSet<BigDecimal>();
    int num=statement.executeUpdate(updateQuery);
    assertEquals("Not all records in the database were updated",numberOfRecords,num);
    result=statement.executeQuery(selectQuery);
    assertTrue("Not all records were updated",values.isEmpty());
    result.close();
  }
 catch (  SQLException e) {
    fail("Unexpected exception" + e.getMessage());
  }
}

public void testUpdate5 ( ) { int factor = 3 ; String updateQuery = "UPDATE " + DatabaseCreator . TEST_TABLE1 + " SET field2=field2 *" + factor ; try { String selectQuery = "SELECT field2 FROM " + DatabaseCreator . TEST_TABLE1 ; ResultSet result = statement . executeQuery ( selectQuery ) ; HashSet < BigDecimal > values = new HashSet < BigDecimal > ( ) ; int num = statement . executeUpdate ( updateQuery ) ; assertEquals ( "Not all records in the database were updated" , numberOfRecords , num ) ; result = statement . executeQuery ( selectQuery ) ; assertTrue ( "Not all records were updated" , values . isEmpty ( ) ) ; result . close ( ) ; } catch ( SQLException e ) { fail ( "Unexpected exception" + e . getMessage ( ) ) ; } }
updatefunctionalitytest # testupdate5 ( ) . updates values in one columns in the table using condition
