log.info("Altering foreign keys ...");
if (log != null) log.info("Altering foreign keys ...");
    private void alterForeignKeys(boolean cascade) throws SQLException    {        log.info("Altering foreign keys ...");        if (!con.getAutoCommit())            con.setAutoCommit(true);        // add FOREIGN KEY's        for (int i = 2; i <= TABLE_COUNT; i++) {            String thisTable = getTableName(i);            String refTable = getTableName(i - 1);            StringBuffer sql = new StringBuffer(100);            sql.append("ALTER TABLE ");            sql.append(thisTable);            sql.append(" DROP CONSTRAINT FK_");            sql.append(refTable);            execute(sql.toString(), true);            sql.replace(0, sql.length(), "ALTER TABLE ");            sql.append(thisTable);            sql.append(" ADD CONSTRAINT FK_");            sql.append(refTable);            sql.append(" FOREIGN KEY (ID_");            sql.append(refTable);            sql.append(") REFERENCES ");            sql.append(refTable);            sql.append(" (ID)");            if (cascade)                sql.append(" ON DELETE CASCADE");            execute(sql.toString(), true);        }    }