I recommend defining the connection pool (and the connections themselves) in the tomcat resources (Context). For a couple of reasons:
1. There are actually several different database connection poolers available to Tomcat. The most common one is Apache DBCP, but it's not the only one. If you specify the connection pooler externally as a Tomcat resource, you don't have to rebuild your application if you want to try a different pooler for performance reasons or to get around pooler bugs.
2. If you specify the connection info externally, you can switch to an alternate database without recompiling and rebuilding the app. This can be useful for disaster recovery purposes. It's also good for
testing. Whenever I can, I build my apps so that the test WAR and the production WAR are the same WAR and all the test/production definitions are external. That way I'm assured that the code in production is the same code as what I tested.