public void testUpdate5() throws SQLException {
  DatabaseCreator.fillFKCascadeTable(conn);
  statement.executeUpdate("UPDATE " + DatabaseCreator.PARENT_TABLE + " SET id = 5 WHERE id = 1;");
  ResultSet r=statement.executeQuery("SELECT COUNT(*) " + "FROM " + DatabaseCreator.FKCASCADE_TABLE + " WHERE name_id = 1;");
  r.next();
  assertEquals("Should be 2 rows",2,r.getInt(1));
  r=statement.executeQuery("SELECT COUNT(*) " + "FROM " + DatabaseCreator.FKCASCADE_TABLE + " WHERE name_id = 5;");
  r.next();
  assertEquals("Should be 0 rows",0,r.getInt(1));
  r.close();
}

public void testUpdate5 ( ) throws SQLException { DatabaseCreator . fillFKCascadeTable ( conn ) ; statement . executeUpdate ( "UPDATE " + DatabaseCreator . PARENT_TABLE + " SET id = 5 WHERE id = 1;" ) ; ResultSet r = statement . executeQuery ( "SELECT COUNT(*) " + "FROM " + DatabaseCreator . FKCASCADE_TABLE + " WHERE name_id = 1;" ) ; r . next ( ) ; assertEquals ( "Should be 2 rows" , 2 , r . getInt ( 1 ) ) ; r = statement . executeQuery ( "SELECT COUNT(*) " + "FROM " + DatabaseCreator . FKCASCADE_TABLE + " WHERE name_id = 5;" ) ; r . next ( ) ; assertEquals ( "Should be 0 rows" , 0 , r . getInt ( 1 ) ) ; r . close ( ) ; }
updatefunctionalitytest2 # testupdate5 ( ) . updates row with referencing ones and cascade action - expecting that all referencing rows will also be updated
