title: Run while(resultset.next()) parallely
body: <p>In java 7 . </p>
  
  <p>I have a query. </p>
  
  <pre><code>String sql = "select path, job_id from job_table where status = 'NEW' and rownum &lt;= 5 order by created_date"; 
  
  
   ResultSet rows = null; 
   try 
   {  
        conn = getConnection();
        preparedStatement = conn.preparedStatement(sql);
       rows  =preparedStatement.executeQuery();
  
        while(rows.next())
       {  
  
    // do stuff or call respective methods depending on the values received from resultset.
  </code></pre>
  
  <p>//suppose row has value 1 or 2 or 3 then</p>
  
  <pre><code> if(rows.contains(1))
      doAnalysis1(param1);
  
   if(rows.contains(2))
      doAnalysis2(param1);
  
  
   if(rows.contains(3))
      doAnalysis3(param1);
  
     }
   }
  </code></pre>
  
  <p>Now what I is to do stuff parallely. Previously when I run my application actually it completes the other functionality for each row and then processess the next row.  But If I got 3 to 4 rows then it should process all at once.. How this can be achieved? Any example would help me.</p>