As explained in a previous lesson, WebSphere® Application Server uses database connection information in the EAR project. Tomcat uses database connection information in the web project. Thus, the database connection steps differ for each server.

If you are using Tomcat, your project doesn't have an EAR project, so EGL added a contexts file to the web project that gives the information for the connection. The contexts file performs essentially the same task as the information in the deployment descriptors: it associates the JNDI name with the location of the database and other information that the server needs to connect to it. The connection is valid only for this project.