title: Improve JDBC Performance
body: <p>I am executing the following set of statements in my java application. It connects to a oracle database.</p>
  
  <pre><code>stat=connection.createStatement();
  stat1=commection.createstatement();
  ResultSet rs = stat.executeQuery(BIGQUERY);
  while(rs.next()) {
      obj1.setAttr1(rs.getString(1));
      obj1.setAttr2(rs.getString(1));
      obj1.setAttr3(rs.getString(1));
      obj1.setAttr4(rs.getString(1));
  
      ResultSet rs1 = stat1.executeQuery(SMALLQ1);
      while(rs1.next()) {
         obj1.setAttr5(rs1.getString(1));
      }
  
       ResultSet rs2 = stat1.executeQuery(SMALLQ2);
      while(rs2.next()) {
         obj1.setAttr6(rs2.getString(1));
  
      }
           .
           .
           .
   LinkedBlockingqueue.add(obj1);
   }
   //all staements and connections close
  </code></pre>
  
  <p>The <code>BIGQUERY</code> returns around 4.5 million records  and for each record, I have to execute the smaller queries, which are 14 in number. Each small query has 3 inner join statements.</p>
  
  <p>My multi threaded application now can process 90,000 in one hour. But I may have to run the code daily, so I want to process all the records in 20 hours. I am using about 200 threads which process the above code and stores the records in linked blocking queue.</p>
  
  <p>Does increasing the thread count blindly helps increase the performance or is there some other way in which I can increase the performance of the result sets?</p>
  
  <p>PS : I am unable to post the query here, but I am assured that all queries are optimized. </p>