It is quite strange that you speak about a dataSource from jndi
(java:comp/env/jdbc/dataSource), given that you give a datasource
configuration from a Spring context file which uses
org.apache.commons.dbcp.BasicDataSource directly and which does not
use your jndi datasource.
But anyway, we can probably ignore the jndi dataSource and use
Spring to monitor the "defaultDataSource".
For that, you don't have to change the jdbc driver: you do not have
to use net.bull.javamelody.JdbcDriver.
You can simply add
"classpath:net/bull/javamelody/monitoring-spring.xml" in the web.xml
file: open the web.xml file and find the
then add the monitoring-spring.xml like this :
It should be enough to monitor the "defaultDataSource" from your
spring context and so the sql requests (because
monitoring-spring.xml contains a post-processor for DataSources).
Note that I have not tested it myself with Alfresco.
By the way, you could also probably monitor various beans of
Alfresco from your Spring context, see the following chapter:
You will have to define a pointcut based on an Alfresco interface or
based on a jdk regexp for example. And it's up to you to find the
beans which can and should be monitored.