In a Java EE web application, database connections must be managed and integrated in the EJB; warfare must not know anything about the data source or database connection information.
If you can choose which technology to include in your web application, I highly recommend Spring to manage database connections.
Struts2 + Spring Integration Example .
Note. Spring libraries have nothing to do with Spring MVC, which is an alternative to the Framework for Struts2.
Edit
Things are changing now for persistence / ORM. I offer pure Java EE JPA2 on top of Spring.
source share