title: ResultSet not populating with results
body: <p>I am attempting to pull results from an Oracle database. I have written a query that is correct, and produces accurate results when issued manually in sqlplus. Furthermore, the code works as expected when when the query matches only one row (In other words, when the ResultSet has only one row, everything works). However, when more than one row match the query, the ResultSet returned by the Oracle JDBC is empty. </p>
  
  <pre><code>public Component[] getAllComponents(int typeId, int osId) throws SQLException
  {
      String query= "SELECT c.component_id, c.component_name, c.component_version, c.type_id, c.post_download_instructions, "
                  + "o.os_id, o.os_name, o.description AS os_description, "
                  + "i.file_location, i.release_date, i.patch_number, i.file_id, "
                  + "i.description AS i_description "
                  + "FROM components c, installation_files i, operating_systems o "
                  + "WHERE c.type_id = ? " 
                  + "AND i.os_id = ? " 
                  + "AND c.component_id = i.component_id "
                  + "AND i.os_id = o.os_id";
  
      ResultSet results       = null;
      PreparedStatement stmt  = null;
      ArrayList&lt;Component&gt; found = new ArrayList&lt;Component&gt;();
  
      try {
          stmt = dbConn.prepareStatement(query); //dbConn is member variable
  
          stmt.setInt(1, typeId);
          stmt.setInt(2, osId);
  
          results = stmt.executeQuery();
  
          while(results.next()){
              //Some logic
          }
  
      } finally {
          if(results != null) results.close();
          if(stmt != null) stmt.close();
          dbConn.close();
      }
  
      //More Code
      //etc. etc.
  </code></pre>
  
  <p>Inspecting the ResultSet shows that calling ResultSet.next() never produces <code>true</code> when the fetched results should contain more than one row. However, issuing the query manually does produce results, and when only one row is returned, everything works fine. Does anyone know what's going on? I'm using Oracle's ojdbc6.jar.</p>
  
  <p>Thanks!</p>