...
The following article provides concept-rich documentation on how to use JNDI to access connection pools for data sources, Java Messaging Services (JMS), mail sessions, and URL connections: Apache Geronimo JNDI naming and Java resource connection pools, Part 1: Data source connections. URL: http://www-128.ibm.com/developerworks/opensource/library/os-ag-jndi1
However, the mentioned article is written for Geronimo 1.x. This sample tutorial will demonstrate something similar but using EJB 3.0.
...
You can checkout the source code of this sample from SVN:
svn checkout http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/CustomerService
Configuring
Configuration of the application consists of creating the database and defining the connection pool to access it.
...
To test the sample web application open and browse and type http://localhost:8080/service. It will forward you to the index page of the application which has a direct link to view the Customers.