Java MySQL connetion pool is not working

后端 未结 4 990
猫巷女王i
猫巷女王i 2021-01-26 03:46

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

4条回答
  •  面向向阳花
    2021-01-26 04:19

    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.

提交回复
热议问题