javafx 2.1 combobox
<p>I used this code to get values from database but can get only one record but I want to put all records in to the combobox.</p>

<p>My code is:</p>

<pre class="lang-java prettyprint-override"><code>try {
    stm = db.con.createStatement();

    rs = stm.executeQuery("select code from accounts");

    while (rs.next()) {
        for (int i = 1; i &lt;= 5; i++) {
            ol = rs.getObject(i);
        }

    }
} catch (SQLException sqlException) {
}

ObservableList&lt;Object&gt; options = FXCollections.observableArrayList(ol);

final ComboBox code = new ComboBox();

code.getItems().addAll(options);
</code></pre>
