- Posted by: gokul gokul
- Posted on: November 19 2000 01:59 EST
i had a bean with method returning result set in try catch block (try part had sql select statement. This bean was deployed as Stateless Session bean ) . The bean during the deployment did not gave any error . but when i tried to access the method using JSP from bean , the method throws error. Cannot we have a result set object as return type for method? I need more clarifications regarding this
- Method returning Result set by Ram Mahajan on November 19 2000 02:09 EST
- Method returning Result set by Uday Natra on November 19 2000 12:13 EST
- Method returning Result set by santosh shitole on November 19 2000 12:34 EST
- Method returning Result set by Kris Gillespie on November 20 2000 07:35 EST
The object coming from a bean to JSP need to be serializable ...
Can you give the description of the error????
ResultSet is an interface and not Serializable, so it cannot be moved in RMI framework as it is. u can wrap ResultSet in a wrapper class which is Serializable. this can be a return type of a Remote method.
hope this help u.
Pls see my thrad in the patterns section. As states a java.sql.ResultSet implementation is not necessarily serializable. Thats why with Sybase EAServer we provide an IDL implementation of a ResultSet as well as static methods to convert to and from a java.sql.ResultSet. In this way you can also get the significant performance boost from marshalling an IDL type via RMI over IIOP.
Were working on porting our conversion routines to make them open source. As soon as they are ported I'll post them in my pattern.
Internet Applications Division
Sun make a serialisable class you can use
(you need to register with them tho)
"A disconnected RowSet object, such as a CachedRowSet object or a WebRowSet object, can be thought of as a set of rows that are being cached outside of a data source. Because they are lightweight and serializable, disconnected rowsets can be passed between different components of a distributed application, such as Enterprise JavaBeansTM components. This is one of the most important uses for a RowSet object. The data in a RowSet object may be updated and then resynchronized with the underlying tabular data source."
I use it and it works nicely, plus, it doesnt cost :)
which is ALWAYS good
Take it easy and have fun