public int getTwoDegrees(String performer1, String performer2) throws SQLException {
        LinkedList<String> select = new LinkedList<String>();
        select.add("Performers");
        LinkedList<String> from = new LinkedList<String>();
        from.add("Videos");
        LinkedList<Pair<String, String>> whereClauses = new LinkedList<Pair<String, String>>();
        whereClauses.add(new Pair<String, String>("Performers LIKE ?", '%' + performer1 + '%'));
        LinkedList<String> whereConjunctions = new LinkedList<String>();
        ResultSet resultSet = executeDynamicQuery(select, from, whereClauses, whereConjunctions, null, null, 0);

        HashSet<String> performersLeft = new HashSet<String>();
        HashSet<String> seen = new HashSet<String>();
        while (resultSet.next()) {
            for (String performer : resultSet.getString(1).split(",")) {
                if (performer.equals(performer2)) {
                    return 1;
                }
                if (performer.equals(performer1)) {
                    seen.add(performer);
                }
                performersLeft.add(performer);
            }
        }

        HashSet<String> performersRight = new HashSet<String>();
        whereClauses.set(0, new Pair<String, String>("Performers LIKE ?", '%' + performer2 + '%'));
        resultSet = executeDynamicQuery(select, from, whereClauses, whereConjunctions, null, null, 0);
        while (resultSet.next()) {
            for (String performer : resultSet.getString(1).split(",")) {
                if (performersLeft.contains(performer)) {
                    return 2;
                }
                if (performer.equals(performer2)) {
                    seen.add(performer);
                }
                performersRight.add(performer);
            }
        }

        return 0;
    }