Originally posted by Anthony Smith:
I got a bean that when called it retuns a result set
Bad idea.
The purpose of beans is to hide database details from the JSP layer. It is a good practice to separate the layers and hide the details of one from the other.
With this in mind, your bean should return the data from the ResultSet, not the ResultSet itself.
Personally I don't use beans, but the behaviour is the same. Your JSP should call some Business logic layer that must gather the data and perform any data manipulation on it. The Business layer is then responsible for the data from the database and can also manage closing connections etc before returning to the JSP.
(actually, we tend to place a wrapper on the DB operations so that the Business layer is not responsible for any DB operations. You ask for data and either get it or don't get it)
Once the JSP receives the data, it is then responsible for displaying the data. That is its only responsibility.
Originally posted by Michael Zalewski:
The second would have some property which exposes a List of the first type.
Like he said!
Dave