Not counting jdo or
ejb apps, I don't use JNDI to access the database connection pool directly. I use JRPoolManager. It's a simple wrapper class around configurable database pools. I have several implementations, one for JNDI, one for DbConnectionBroker from javaexchange and one for the special pool class provide by EJIP. The init of JRPoolManager takes a Properties Object and uses that to provide access to the pool. This way, when I want to test simple classes to acces a database, I pass the properties for the DbConnectionBroker and the class works. When it's running for JNDI, it passes the parameters need for that and...
I'm running a project on SourceForge for the Students that belong to our local JUG. The project name is jugsoft
http://www.sourceforge.net/projects/jugsoft I use a version of it there. The project is still pretty young so the docs on how to use it aren't what they should be but, should give you an idea. BTW, there are property files and test cases that function.