why not return resultset
1 posts in topic
Flat View  Flat View

Posted By:   John_Zhang
Posted On:   Tuesday, December 3, 2002 03:07 PM

in alot of example,I saw stateless session bean return table retrieveing result using collection,the collection is base on a class which defined by programmer.
then,for each diffrent table,has to define diffrent class,once table structure changed,class need tobe change.
why not just use rowset,or in weblogic use resultset,in sybase use TabularResults
is the portable between servers the only issue to avoid result set,or there are some others consideration?

Re: why not return resultset

Posted By:   Olivier_Michallat  
Posted On:   Wednesday, December 4, 2002 02:22 AM


The problem is that ResultSet keeps a connection to the database. Therefore you can't return it to the client.

However you can return an object that can be used in the same way as a ResultSet but is disconnected. See the pattern "Data Transfer Rowset" in Floyd Marinescu's book EJB Design patterns (there is a free PDF version available at http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp).
About | Sitemap | Contact