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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]