title: How do I run multiple queries in parallel in java?
body: <p>I have a <code>bean</code> that is getting a lot of information to show on a page.  Each bit of this information is obtained by hitting the <code>db</code> and currently this is happening sequentially.  Here is some sample code from my <code>bean</code>:</p>
  
  <pre><code>int transactionCount = dao.getTransactionCount();
  int personCount = dao.getPersonCount();
  int carCount = dao.getCarCount();
  int houseCount = dao.getHouseCount();
  </code></pre>
  
  <p>I am running <code>Java 7</code>.  How could I run this in parallel?  I have looked at the <code>ExecutorService</code> and <code>ForkJoin</code>, but both seem to have to run the same exact code over and over again.  That is not what I am doing here.  What is the best way to speed this up?</p>