You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@pingsite.com> on 2006/02/20 14:50:18 UTC

[OT] Re: Returning ResultSet

chuanjiang lo wrote:
> Hi guys,
>
> I have this DBConnectionManager class that manages the connection pooling.
> It has this method to get some results from the database.
>
> So my action form make use of the method to get the resultset and tries to
> display on the jsp page.
> But the method would close the connection after i query the database thus my
> resultset is lost.
>
> What should be the correct way of returning a resultset to the action page?
>   
Not returning a ResultSet ;)

There are twice as many options as posters to this list, but in general
either using a full ORM tool (Hibernate, iBatis, Torque, etc.) or,
closer to your existing code, perhaps using RowSetDynaClass from the
Jakarta Commons beanutils would be the easiest.

http://jakarta.apache.org/commons/beanutils/
http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.7.0/docs/api/
http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.7.0/docs/api/org/apache/commons/beanutils/RowSetDynaClass.html

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org