private boolean execCreateFtrSimilarities(VectorMap queryParam, StringBuffer respBody, DBAccess dbAccess) {
        try {
            int clntIdx = queryParam.qpIndexOfKeyNoCase("clnt");
            String clientName = (String) queryParam.getVal(clntIdx);
            Statement stmt = dbAccess.getConnection().createStatement();
            String sql = "SELECT * FROM " + DBAccess.FEATURE_TABLE + " WHERE " + DBAccess.FIELD_PSCLIENT + "='" + clientName + "' AND " + DBAccess.FEATURE_TABLE_FIELD_FEATURE + " LIKE 'movie.%'";
            ResultSet rs = stmt.executeQuery(sql);
            Vector<String> ftrs = new Vector<String>();
            while (rs.next()) {
                ftrs.add(rs.getString(DBAccess.FEATURE_TABLE_FIELD_FEATURE));
            }
            rs.close();

            String sql1 = "SELECT " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_DST + " ftr," + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_WEIGHT + " FROM " + DBAccess.UFTRASSOCIATIONS_TABLE + " WHERE " + DBAccess.FIELD_PSCLIENT + "='" + clientName + "' AND " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_USR + "='' AND " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_SRC + "=? AND " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_TYPE + "=" + DBAccess.RELATION_PHYSICAL;
            String sql2 = "SELECT " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_SRC + " ftr," + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_WEIGHT + " FROM " + DBAccess.UFTRASSOCIATIONS_TABLE + " WHERE " + DBAccess.FIELD_PSCLIENT + "='" + clientName + "' AND " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_USR + "='' AND " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_DST + "=? AND " + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_TYPE + "=" + DBAccess.RELATION_PHYSICAL;
            sql = "(" + sql1 + ") UNION (" + sql2 + ")";
            PreparedStatement assocs = dbAccess.getConnection().prepareStatement(sql);

            String sqlIns = "REPLACE DELAYED INTO " + DBAccess.UFTRASSOCIATIONS_TABLE + "(" + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_SRC + "," + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_DST + "," + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_TYPE + "," + DBAccess.UFTRASSOCIATIONS_TABLE_FIELD_WEIGHT + "," + DBAccess.FIELD_PSCLIENT + ") VALUES ("
                    + "?,?," + DBAccess.RELATION_FEATURE_SIMILARITY + ",?,'" + clientName + "')";
            PreparedStatement insAssoc = dbAccess.getConnection().prepareStatement(sqlIns);


            for (int i = 0; i < ftrs.size(); i++) {
                insAssoc.clearBatch();
                System.out.println("associations for " + ftrs.get(i));
                assocs.setString(1, ftrs.get(i));
                assocs.setString(2, ftrs.get(i));
                rs = assocs.executeQuery();
                Set<String> coFtrs = new HashSet<String>();
                while (rs.next()) {
                    coFtrs.add(rs.getString(1));
                }
                rs.close();
                for (int j = i + 1; j < ftrs.size(); j++) {
                    float common = 0;
                    float all = coFtrs.size();
                    assocs.setString(1, ftrs.get(j));
                    assocs.setString(2, ftrs.get(j));
                    rs = assocs.executeQuery();
                    while (rs.next()) {
                        String ftr = rs.getString(1);
                        if (coFtrs.contains(ftr)) {
                            common++;
                        } else {
                            all++;
                        }
                    }
                    rs.close();

                    if (common > 0) {
                        float dist = common / all;
                        insAssoc.setString(1, ftrs.get(i));
                        insAssoc.setString(2, ftrs.get(j));
                        insAssoc.setFloat(3, dist);
                        insAssoc.addBatch();
                    }
                    //System.out.println( insAssoc.toString() );
                }
                insAssoc.executeBatch();
            }
            insAssoc.close();
            assocs.close();

        } catch (SQLException ex) {
            WebServer.win.log.error(ex.toString());
            ex.printStackTrace();
            return false;
        }
        return true;
    }