Trying to dynamically generate a HTML drop down list in a JSP from my postgres DB
<p>I am trying to dynamically generate a drop down list that contains the second column of my table "city" from my database and I am using postgresql as my DBMS. The drop down list generates on my JSP page and the correct number of options are generated. My problem is that all of the options in the drop down list are just blank white space. I'm pretty sure I am properly connected to the database, I am just not too sure why the contents of my drop down list are empty.</p>

<pre><code>&lt;html&gt;
&lt;body&gt;

&lt;%  
    try{
        Class.forName("org.postgresql.Driver");
        Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost/db");
        Statement statement = connection.createStatement();
        rs = statement.executeQuery("SELECT * FROM city");
%&gt;
&lt;div id = "menu"&gt;
    &lt;select&gt;
        &lt;%
            while (rs.next()){
        %&gt;
        &lt;option&gt;
            &lt;% rs.getString(2); %&gt;
        &lt;/option&gt;
        &lt;% } %&gt;
    &lt;/select&gt;
&lt;/div&gt;
&lt;%
    }

    catch (Exception e){
    out.println("ERROR: " + e);
    }
%&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>