title: Parallelize a for loop in java
body: <p>I have a for loop that is looping over a list of collections. Inside the loop some select/update queries are taking place on collection which are exclusive of the other collections. Since each collection has a lot of data to process on i would like to parallelize it.</p>
  
  <p>The code snippet looks something like this:</p>
  
  <pre><code>//Some variables that are used within the for loop logic
   for(String collection : collections) {
      //Select queries on collection
      //Update queries on collection
  }
  </code></pre>
  
  <p>How can i achieve this in java?</p>