Since
Struts uses the MVC (Model/View/Controller) model, it encourages separation of these three elements of an application. Since the JSP is part of the View, it really shouldn't be performing functions that belong to the realm of the Model. Since database access is considered part of the Model, Struts provides no utilities for accessing a database in a JSP and discourages you from doing so.
When writing a Struts application, you will generally write the JSP so that it only deals with how to present and collect the data. When the user submits the form, struts calls the appropriate action class. Your action class should then delegate the task of accessing the database to some Model objects. You may want to check out some of the
patterns and frameworks available for database access and object/relational mapping such as
JDBC using the Data Access Object Pattern, JDO (
Java Data Objects), Hibernate, etc.