• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question for Kyle or WAS Expert : Help with creating EJB ResultSet

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Kyle, I'm new to WAS/WASD and have been looking through your book I purchase recently. I don't know if my approach is correct but I need
to return an EJB result set from WAS to an external service run by Crystal Enterprise which expects an EJB data source.

I need to create an EJB in IBM Websphere which returns a resultset
(from database query), I assume it will be session bean that is invoked by the external service which then kicks of an entity bean for getting the result set.

Could yo point me to some code that that accepts some parameters for
producing the result set, then does the work (can any be any query) and returns the result set.

Any pointers would be very much appreciated.

Thanks!
[ July 14, 2004: Message edited by: Azeem Sattar ]
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not believe a result set is serializable. Therefore, you would have problems returning it from an EJB. In my opinion, best practice may be to create a javabean that is Serializable. For each result returned from the query, populate an instance of this bean and put the bean in a List. Return the List of beans instead of a ResultSet.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bill is right. You can't return a ResultSet from an EJB. Can you point us at some online documentation on Crystal that indicates what they're really looking for? That might give us more of an indication of what to go on.

Kyle
 
M Aslam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle/Bill,

Thanks very much for your response. I can't seem to find any concrete examples on the web. However , here is a URL to Cystal's paper on this issue, please esee page 2

http://support.businessobjects.com/communityCS/TechnicalPapers/cr9_java.pdf
'Connectivity to Custom Java Data Sources'.

I'll try and ask Crystal directly, in the meantime hope the above helps.

Looking forward to hearing from you...

NB Great book Kyle :-)
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Azeem! Well, I agree that Crystal doesn't give you much to go on. I'm not sure how they intend to make this work as an EJB -- my only guess is that the EJB and the POJO interfaces are very different...

Kyle
 
M Aslam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm told that the serialize problem is overcome by the use of a
RowSet class that serves mainly as a thin wrapper around a ResultSet object to make a JDBC driver look like a JavaBeans.

The rowset I'm told is serializable, cached rowsets can be created and transferred across the wire since it is serializable and cloneable. For example, my EJB component can create and return a cached rowset to a client across the network.

Am I on the right track now? so it looks like I now need to know now an EJB
can create and return a cached rowset.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if they're just creating Javabeans that happen to implement the java.sql interfaces, it would work, but this seems like it would be dependent on their own classes.

Kyle
 
reply
    Bookmark Topic Watch Topic
  • New Topic