title: java.sql.SQLException: Column not found
body: <p>Pretty simple assignment here and I thought I had everything correct but apparently not :(</p>
  
  <p>Basically all this jsp needs to do is display distinct values from a DB in a drop down and based on the selected value when the user presses the submit button they will be directed to another jsp where in a table it will display other values that correspond to it. I have emailed my professor and he is reluctant to responding. Any help is much appreciated! Here is my code and thanks for your time and help!</p>
  
  <pre><code>try
  {
            String query3 = "SELECT DISTINCT CATEGORY FROM POEMS;";
            ResultSet rs3 = stmt3.executeQuery(query3);  
            rs3.next();
  %&gt;  
            &lt;FORM ACTION="purcell6b.jsp" METHOD="POST"&gt;
  &lt;%
            out.println("&lt;SELECT name='category'&gt;");
            while (rs3.next())
            {
                String category = rs3.getString("CATEGORY");
  
                out.println("&lt;OPTION value='" + category + "'&gt;" + category);
                out.println("&lt;/OPTION&gt;");
             } 
             out.println("&lt;/SELECT&gt;");
  %&gt; 
             &lt;input type = submit value="Submit"&gt;
             &lt;/form&gt;
  &lt;%  
  }
  catch (Exception e)
  {
     e.printStackTrace();     
  }
  </code></pre>
  
  <p>
  </p>
  
  <hr>
  
  <p>Second JSP:</p>
  
  <p>String query = "select POEMID, DESCRIPTION, TITLE, POETID " + "from POEMS WHERE CATEGORY like ?;";</p>
  
  <pre><code>try
  {
      stmt.setString(1, input1);
      ResultSet rs = stmt.executeQuery();
  </code></pre>
  
  <p>
     </p>
  
  <pre><code>&lt;%
      while (rs.next())
      {
         String poemID = rs.getString("POEMID");
         String title = rs.getString("TITLE");
         String description = rs.getString("DESCRCIPTION");
         String catetgory = rs.getString("CATEGORY");
         String poetID = rs.getString("POETID");
  
  %&gt;
  &lt;TR&gt;
         &lt;TD&gt;&lt;input type='radio' name='poemID' value='&lt;%=poemID%&gt;'&gt; &lt;/TD&gt;
         &lt;TD&gt;&lt;%= poemID %&gt;&lt;/TD&gt;
         &lt;TD&gt;&lt;%= title %&gt;&lt;/TD&gt;
         &lt;TD&gt;&lt;%= description %&gt;&lt;/TD&gt;
         &lt;TD&gt;&lt;%= catetgory %&gt;&lt;/TD&gt;
         &lt;TD&gt;&lt;%= poetID %&gt;&lt;/TD&gt;
  
         &lt;/TR&gt;
  &lt;%
      }
  %&gt;
      &lt;/TABLE&gt;
      &lt;/FORM&gt;
  </code></pre>
  
  <p>&lt;%
      }
      catch (Exception e)
      {
         e.printStackTrace();<br>
      }</p>
  
  <p>I know how to insert into a table its just the passing of the parameter that I'm confused on.</p>
  
  <p>Thanks!
  Corey </p>