On 5/4/18 12:49 AM, Shawn Heisey wrote:
> Using dbcp 2.2.0 with pool 2.5.0.
>
> If the only object I have access to is BasicDataSource, is it
> possible to obtain the SQL queries being executed by active
> connections in the pool right now?  If so, how would I go about
> doing that?
>
> At the moment I'm not using PreparedStatement, but I have plans to
> do so in the future.  When that happens, I will be interested in
> finding the actual query being executed, not the query with the
> question mark placeholders.
>

The only thing close to this that you can do now is if you have
prepared statement pooling enabled, then via the JMX instrumentation
of commons pool you can see the output of statement.toString().  
See listAllObjects in GenericObjectPoolMXBean.  Again, the pool you
need to walk to get this is the prepared statement pool associated
with an individual connection, not the connection pool.

Phil
> Thanks,
> Shawn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to