Leave the
IDE out of it.
Tomcat itself doesn't do database connection pooling. It supports plugin poolers. The Apache DBCP pooler is provided as part of the Tomcat distro, however, so that eliminates the need for you to download and install a separate connection pooler unless you really want to.
To the best of my recollection, the same configuration instructions apply for connection poolers (DataSources) for Tomcat 3 all the way up to Tomcat 7 and the instructions on the tomcat.apache.org website are pretty clear, I think.
To create, configure, and use a database connection pooler, you define the datasource(s) in your webapp context definition or in the global server config. That definition specifies the location of the database of interest (URL), its connection credentials and parameters, and whatever pool tuning and diagnostic options you wish to employ. It also binds the DataSource to a jndi name so that the webapp(s) can locate it by an abstract identifier rather than by having to supply specifics within the webapp itself.
In the webapp, you set up a resource-ref in web.xml. The you use JNDI to locate the DataSource whenever you wish. You can do this at startup and cache the DataSource object for later use if you prefer to reduce the JNDI overhead.
An app may employ multiple DataSources. Normally you'd want all connections to a specific database to use the same connection pool, but I have several apps that connect to multiple databases, so each database has a corresponding DataSource.