Just to give slight background, I needed to encrypt the username/password fields of server.xml(TOMCAT) using the custom DataSourceFactory implementation.
There were many good answers and while some of them explained while extending
org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory whereas some of the answers had org.apache.tomcat.jdbc.pool.DataSourceFactory extended.
Some of the links I referred:
http://www.jdev.it/encrypting-passwords-in-tomcat/
So the question in my mind is what's the difference between the two and which one should be preferred when?