title: Java : Creating a Thread Pool in the Server application
body: <p>I want to create a ThreadPool for a series of database calls(serial). We want to save those milliseconds. So we don't want to waste time in executing the database queries in serial.
  I'm working on a server application which already have many parallel nodes. In one of those nodes there are a series of database calls. I want to introduce parallelism inside a node that already running in parallel with other nodes.</p>
  
  <p>Is thread pool executor a good choice? I don't know how many queries I'll be running. It depends on the state of the request object. So I can't fix the queue size of the thread pool.</p>
  
  <p><a href="http://programmingexamples.wikidot.com/threadpoolexecutor" rel="nofollow">This is the example that I have found.</a></p>
  
  <p>Is this efficient? Is there any other alternative? Any suggestions will be appreciated.</p>