Method returning Result set

Discussions

EJB design: Method returning Result set

  1. Method returning Result set (5 messages)

    hi
    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

    Threaded Messages (5)

  2. Method returning Result set[ Go to top ]

    The object coming from a bean to JSP need to be serializable ...
  3. Method returning Result set[ Go to top ]

    Can you give the description of the error????
  4. Method returning Result set[ Go to top ]

    hi Ram,
    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.
    bye,
    Santosh,
    mail2santosh@lycos.com
  5. Method returning Result set[ Go to top ]

    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.

    Dave Wolf
    Internet Applications Division
    Sybase
  6. Method returning Result set[ Go to top ]

    Sun make a serialisable class you can use

    http://developer.java.sun.com/developer/earlyAccess/crs/

    (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