title: Play Framework: How to create & use connection pool?
body: <p>In the Play documentation there is this example:</p>
  
  <pre><code>public class AsyncTest extends Controller {
  
    public static void remoteData() {
      F.Promise&lt;WS.HttpResponse&gt; r1 = WS.url("http://example.org/1").getAsync();
      F.Promise&lt;WS.HttpResponse&gt; r2 = WS.url("http://example.org/2").getAsync();
      F.Promise&lt;WS.HttpResponse&gt; r3 = WS.url("http://example.org/3").getAsync();
  
      F.Promise&lt;List&lt;WS.HttpResponse&gt;&gt; promises = F.Promise.waitAll(r1, r2, r3);
  
      // Suspend processing here, until all three remote calls are complete.
      List&lt;WS.HttpResponse&gt; httpResponses = await(promises);
  
      render(httpResponses);
    }
  }
  </code></pre>
  
  <p>In the above example 3 new <code>HTTP</code> connections to <code>example.org</code> are created, correct?</p>
  
  <p>Is there any way to create a pool of connections on start up, and then just grab and reuse connections from that pool instead of creating and tearing down connections repeatedly?</p>
  
  <p>Ideally I can have multiple pools of connections, e.g. a pool of HTTP connection, a pool of DB connections, etc. How can I do that?</p>
  
  <p>Thanks.</p>