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
Your can pre-load your pool by calling connectionPool.addObject(). At the start it is empty and creates a connection only after you've posted a query.
connectionPool.addObject()