title: ResultSet loses first value
body: <p>Code seems to work fine, but I noticed whenever I queried a string with only one result, it returned nothing.  Somehow I am skipping the first result I think but have no idea why.</p>
  
  <pre><code>    else{
     Conn con = null;
     try {
      con = new Conn();
     } catch (Exception e) {
  
      e.printStackTrace();
     }
     String sql = "SELECT productname, quantityperunit, unitprice FROM products pr, categories ca WHERE pr.categoryID = ca.categoryID AND ProductName LIKE '%" + searchTerm + "%'";
     System.out.println("last try");
     try {
      searchResults = con.query(sql);
  
      if (searchResults.next()){
       session.setAttribute("searchResults", searchResults);
      }
  
  
     } catch (Exception e) {
  
      e.printStackTrace();
     } 
  
  
    }
  </code></pre>
  
  <p>and this is the display code:</p>
  
  <pre><code> java.sql.ResultSet resultSet = (java.sql.ResultSet) session.getAttribute("searchResults");
      if(resultSet == null){
       out.println("Nullified");
      }
   if(resultSet!=null){
    out.println("&lt;table border='1'&gt;");
       out.println("&lt;tr&gt;&lt;th&gt;Product Name&lt;/th&gt;&lt;th&gt;Quantity per Item&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;th&gt;Quantity&lt;/th&gt;&lt;th&gt;&lt;Add to Cart&lt;/th&gt;&lt;/tr&gt;");
       while(resultSet.next()){      
        out.println("&lt;tr&gt;&lt;td&gt;"+resultSet.getString("ProductName")+"&lt;/td&gt;&lt;/tr&gt;");
       }
       out.println("&lt;/table&gt;");
   }
  </code></pre>
  
  <p>any help would be appreciated.</p>