Background:
There are at least three parts of TB Java code that need DB connections: the web application (WAR), the tests, and data importing utilities (in /treebase-core/src/main/java/org/cipres/treebase/util).
After Jan 2010 switch to using JNDI DataSource, DB credentials needed by the webapp are specified in /treebase-web/target/treebase-web/META-INF/context.xml as a JNDI resource.
DB credentials used by tests and import utilities are still read from /treebase-core/src/main/resources/jdbc.properties. (See treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java)
The corresponding Spring dataSource beans are declared in /treebase-core/src/main/resources/{applicationContext-db-webapp.xml,applicationContext-db-standalone.xml}
The problems:
(1) The standalone datasource still uses com.mchange.v2.c3p0.ComboPooledDataSource rather than Apache commons-dbcp supplied by Tomcat to the web app.
(2) The fact that the standalone apps retrieve DB credentials from inside the code tree (jdbc.properties) is still somewhat uncomfortable.
Any solution should keep it possible to specify separate DB credentials for each separate application.