title: java-Executor Framework
body: <p>Please look at my following code.... </p>
  
  <pre><code>  private static final int NTHREDS = 10;
    ExecutorService executor = Executors.newFixedThreadPool(NTHREDS);
    while(rs.next()){
              webLink=rs.getString(1);
              FirstName=rs.getString(2);
              MiddleName=rs.getString(3);
              Runnable worker = new MyRunnable(webLink,FirstName,MiddleName);// this interface has run method....
              executor.execute(worker); 
  
     }
  </code></pre>
  
  <p>//added </p>
  
  <pre><code>      public class MyRunnable implements Runnable  {
  
  
        MyRunnable(String webLink,String FirstName,String MiddleName){
           ** Assigning Values...***
        }
  
        @Override
  
        public void run() {
  
        long sum = 0;
  
        **Calling method to crawl by passing those Values**
  
        try {
  
        Thread.sleep(200);
  
        } 
  
        catch (InterruptedException e)
  
        {
  
        e.printStackTrace();
  
        }
  
        }
  
       }
  </code></pre>
  
  <p>In this part if the resultset(<strong>rs</strong>) having 100 records excutor creating 100 threads..... I need to run this process with in 10 threads. I need your help to know how to get control of threads.. If any thread has completed its task then it should process the immediate available task from the Result Set. Is it possible to achieve using executor framework.</p>
  
  <p>Thanks...</p>
  
  <p>vijay365</p>