This is making my program freeze
<p>every time this starts my program freezes, and I can't figure out why.
It doesn't give any errors, it just freezes.</p>

<p>Is it possible I've created some kind of endless loop?</p>

<pre><code>public  static String[] DataVoorList(int coureur) throws SQLException{

    ArrayList datalijst = new ArrayList();
        String query = ""
                + "SELECT rd_datum, rd_locatie, rd_code "
                + "FROM racedag WHERE rd_code in( "
                + "SELECT i_rd_code "
                + "FROM inschrijvingen "
                + "WHERE i_c_nummer = " + coureur + ");";
        ResultSet rs = Database.executeSelectQuery(query);

        int i=0;
        while (rs.next()){
            String datum = rs.getString("rd_datum");
            String locatie = rs.getString("rd_locatie");
            String totaal = "" + datum + " - " + locatie;
            datalijst.add(i, totaal);
            i++;
            int codeInt = rs.getInt("rd_code");
            String code = ""+codeInt;
            datalijst.add(i, code);
            i++;
        }



    return Race.StringDataVoorList(datalijst);
}

public static String[] StringDataVoorList(ArrayList invoer){
    int lengte = invoer.size();
    String[] uitvoer = new String[lengte];
    int i =0;
    while (i &lt; uitvoer.length){
        uitvoer[i] = ""+invoer.get(i);
    }
    return uitvoer;
}
</code></pre>

<p>EDIT: I've solved the increment. However, it still freezes.</p>

<p>EDIT 2: I think I have located the problem (but I can be wrong)</p>

<pre><code>public static String[] DataVoorList(int coureur) throws SQLException {
    System.out.println("stap 1");
    ArrayList datalijst = new ArrayList();
    String query = ""
            + "SELECT rd_datum, rd_locatie, rd_code "
            + "FROM racedag WHERE rd_code in( "
            + "SELECT i_rd_code "
            + "FROM Inschrijvingen "
            + "WHERE i_c_nummer = " + coureur + ");";
    ResultSet rs = Database.executeSelectQuery(query);

    System.out.println("stap 2");
    int i = 0;
    while (rs.next()) {
        String datum = rs.getString("rd_datum");
        String locatie = rs.getString("rd_locatie");
        String totaal = "" + datum + " - " + locatie;
        datalijst.add(i, totaal);
        System.out.println("stap 3");
        i++;
        int codeInt = rs.getInt("rd_code");
        String code = "" + codeInt;
        datalijst.add(i, code);
        i++;
        System.out.println("stap 4");
    }
    return Race.StringDataVoorList(datalijst);
</code></pre>

<p>(I've changed the while loop to a for loop)</p>

<pre><code>    public static String[] StringDataVoorList(ArrayList invoer) {
    int lengte = invoer.size();
    String[] uitvoer = new String[lengte];

    for (int i = 0; i &lt; uitvoer.length; i++) {
        uitvoer[i] = "" + invoer.get(i);

    }
    return uitvoer;
}
}
</code></pre>

<p>this is being called from here:</p>

<pre><code>public MijnRacedagenScherm() throws SQLException{
    initComponents();
    int gebruiker = Inloggen.getNummer();
    String[] DataVoorList = Race.DataVoorList(2);
    int lengte = DataVoorList.length;
    System.out.println("resultaat is " + DataVoorList[0]);
    int i = 0;
    while (i &lt; lengte) {
        ListRacedagenCoureur.setListData(DataVoorList);
        i = i + 2;
    }
    System.out.println("lengte is " + lengte);
}
</code></pre>

<p>This is a new screen, but in the previous screen I get a <em>unreported SQL exception</em> over this:</p>

<pre><code>private void ButtonZienRacedagActionPerformed(java.awt.event.ActionEvent evt) {                                                  
new MijnRacedagenScherm().setVisible(true);
}                      
</code></pre>
