| Author |
Returning ResultSet from an EJB
|
Prakash Saswadkar
Greenhorn
Joined: Jul 10, 2002
Posts: 6
|
|
Oreilly EJB by RMH talks about returning ResultSet from an EJB to the client.(Page 458-Oreilly) My question - Is it possible to return a ResultSet from a remote method to the client? To use this resultset won't the client require the open connection that is associated with this resultset. Just serializing the resultset and sending it to the client will this maintain also the open connection? If the above thing is possible will the client require the JDBC driver to access this resultset that is returned by remote method?
|
 |
Keith Rosenfield
Ranch Hand
Joined: Nov 25, 2003
Posts: 277
|
|
Originally posted by Prakash Saswadkar: Oreilly EJB by RMH talks about returning ResultSet from an EJB to the client.(Page 458-Oreilly) To use this resultset won't the client require the open connection that is associated with this resultset.
To get a resultset there needs to be a connection but I don't believe that a resultset has an association with a connection after it is returned. A resultset is just another object. Hope this helps,
|
Keith Rosenfield<br />SCJP<br />SCWCD<br />SCBCD
|
 |
Jacky Chow
Ranch Hand
Joined: Sep 01, 2002
Posts: 63
|
|
hi, It is not allowed, the ResultSet is not serialiable, so return a ResultSet to remote client breaks the rules for a RMI-IIOP !
|
Jacky
|
 |
Ken Boyd
Ranch Hand
Joined: Dec 10, 2003
Posts: 329
|
|
Copy your resultset to Collection & they are serializable. Also make sure you have serializable objects or premitives in Collection otherwise you will get runtime error. Hope this help. SCJP 1.4 SCWCD
|
SCJP, SCWCD, SCBCD, SCJD, BB Java2 and JSP1.1
|
 |
Vivek Viswanathan
Ranch Hand
Joined: Mar 03, 2001
Posts: 350
|
|
This article has something about disconnected result sets http://www.javaworld.com/javaworld/jw-02-2001/jw-0202-cachedrow.html hope it helps vivek
|
Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I
|
 |
Nick Bauman
Greenhorn
Joined: Jan 03, 2004
Posts: 12
|
|
|
Sounds like a really bad idea, as it breaks MVC and "Seperation of Concerns" principle. Not to mention breaking the Law of Demeter.
|
 |
 |
|
|
subject: Returning ResultSet from an EJB
|
|
|