Struts-config.xml Add
Add data-source> data-sources>
Enable the following connection database code in your Action class
Import Javax.Servlet.ServletContext; import javax.sql. *;