public void run() throws Exception {
        connection = DriverManager.getConnection(dbUrl);
        // create projects
        PreparedStatement ps = connection
                .prepareStatement("select jg_key, jg_name, jg_description"
                        + " from t_project");
        ps.execute();
        ResultSet rs = ps.getResultSet();
        while (rs.next()) {
            String key = rs.getString(1);
            String name = rs.getString(2);
            String description = rs.getString(3);
            Project p = new Project(key, name, description);
            projects.add(p);
        }
        ps.close();
        // create milestones
        ps = connection
                .prepareStatement("select p.jg_key, v.jg_name, v.jg_description, v.jg_released, v.jg_releasedate"
                        + " from t_project p, t_version v"
                        + " where p.jg_id = v.jg_project");
        ps.execute();
        rs = ps.getResultSet();
        while (rs.next()) {
            MileStone milestone = new MileStone();
            milestone.title = rs.getString(2);
            milestone.description = rs.getString(3);
            milestone.state = "true".equals(rs.getString(4)) ? "closed"
                    : "open";
            milestone.dueOn = rs.getString(5);
            Project p = findProject(rs.getString(1));
            p.milestones.add(milestone);
        }
        ps.close();
        // create issues
        for (Project p : projects) {
            ps = connection
                    .prepareStatement("select issue.jg_key, st.jg_name, issue.jg_summary, issue.jg_description, issue.jg_assignee "
                            + " from t_issue issue, t_project p, t_status st "
                            + " where issue.jg_project = p.jg_id and st.jg_id = issue.jg_status and p.jg_key = ?");
            ps.setString(1, p.key);
            ps.execute();
            rs = ps.getResultSet();
            while (rs.next()) {
                Issue issue = new Issue();
                p.issues.add(issue);
                issue.key = rs.getString(1);
                issue.title = rs.getString(3);
                issue.body = rs.getString(4);
                issue.assignee = rs.getString(5);
                issue.resolution = rs.getString(2);
                if (issue.resolution.equals("Closed")
                        || issue.resolution.equals("Resolved")) {
                    issue.closed = true;
                }
                findRelations(issue);
            }
        }
        ps.close();
        // attributes for each issue
        for (Project p : projects) {
            int i = -1;
            for (Issue issue : p.issues) {
                i++;
                issue.ghId = i + baseGhIssue;
                issue.comments = listComments(issue.key);
                issue.milestone = selectMilestones(p, issue.key);
            }
        }
        connection.close();
    }