I\'ve written a function in Java that runs a MySQL query and returns results. I\'ve implemented connection pooling using this method here: http://www.kodejava.org/how-do-i-creat
You create a connection pool, but you don't put anything into it. You connection pool is empty when it is created, so your first request to it is guaranteed to to create a new connection and will be just as slow as getting a connection manually.
Try putting your code into a loop, where you repeatedly get a connection from the pool. Try it once, five times, ten times and fifteen times. Note how the results change.
Some connection pools support automatically creating and holding a minimum number of connections ready for use as well as a maximum. When the pool is initialised it will pre-fetch connections so the first few calls aren't delayed.