Logging in DBCP

前端 未结 4 784
刺人心
刺人心 2021-02-07 13:59

I\'m using Apache Commons DBCP. There is a task to track the inner behavior of the DBCP - number of active and idle connections.

I found out that DBCP lacks any such lo

4条回答
  •  别跟我提以往
    2021-02-07 14:24

    DBCP's BasicDataSource contains a few protected methods that actually create the pools and the pool factories. You can subclass it and override those methods to change the behavior; for example, to get a hold of the pool factory or replace it with your own. Once you have that pool, you can then get at the pool state within your code.

提交回复
热议问题