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 use case does not warrant a connection pool. Its just one connection you need.
The pool class you are using GenericObjectPool has a method addObject();. This will create and add the objects to the pool. This will avoid creating connection later.