Another reason why we're not real excited when people use an
IDE to build their projects. An IDE can be a big assist, but it's no substitute for actually knowing what's going on.
Every deployed Tomcat webapp has a context. The context defines the base URL for the app, where to find the application's codebase, and additional defined resources, if/as needed, including the Connection Pool (DataSource) definition. If you don't explictly define a context, one will be created for any WAR found in the TOMCAT_HOME/webapps directory, where the context name will be "warname" and the codeBase will be "TOMCAT_HOME/webapps/warname" or "TOMCAT_HOME/webapps/warname.war", depending on whether or not the WAR is exploded.
You can define a context yourself and put it in one of 3 places.
1. As a file named "context.xml" in the META-INF directory of your WAR.
2. As a file whose extension is ".xml" in the TOMCAT_HOME/conf/Catalina/localhost directory (will override #1).
3. As an XML entry in the TOMCAT_HOME/conf/server.xml file (But please don't do this!).
The full documentation on the format of the Context element and its children is on the Tomcat documentation site. Your DataSource definition would be one of those children.