Hi,
By my question u can get it what i am expecting.....
Ya i would like to return an Resultset object using my own getXXX method from a Bean into some Client App so that i can retireve it through a resultset object in my client application.........
Thanks in Advance...
Prashanth.
Discussions
EJB programming & troubleshooting: How to return a ResultSet from an BeanManaged Entity Bean
-
How to return a ResultSet from an BeanManaged Entity Bean (4 messages)
- Posted by: Prashanth Karre
- Posted on: December 28 2000 07:09 EST
Threaded Messages (4)
- How to return a ResultSet from an BeanManaged Entity Bean by sudhir savalajkar on December 28 2000 15:49 EST
- How to return a ResultSet from an BeanManaged Entity Bean by Prashanth Karre on December 29 2000 01:17 EST
-
How to return a ResultSet from an BeanManaged Entity Bean by Kiran Patchigolla on December 29 2000 11:55 EST
- How to return a ResultSet from an BeanManaged Entity Bean by Doan LyDuc on January 01 2001 01:51 EST
-
How to return a ResultSet from an BeanManaged Entity Bean by Kiran Patchigolla on December 29 2000 11:55 EST
- How to return a ResultSet from an BeanManaged Entity Bean by Prashanth Karre on December 29 2000 01:17 EST
-
How to return a ResultSet from an BeanManaged Entity Bean[ Go to top ]
- Posted by: sudhir savalajkar
- Posted on: December 28 2000 15:49 EST
- in response to Prashanth Karre
hello
the method return type make as ResultSet object
and in the method code last line return the resultset object
bye
sudhir -
How to return a ResultSet from an BeanManaged Entity Bean[ Go to top ]
- Posted by: Prashanth Karre
- Posted on: December 29 2000 01:17 EST
- in response to sudhir savalajkar
Hi Sudhir,
Thanks for ur Reply,But Boss I already tried the same method.Hey Take my words(Mantra......)
" U can pass data only through Primitive Types"
Ok,I tryed with Resultset returning through a method and YES it is possible if it is Local Program.BUT IF IT IS ON A REMOTE viz... RMIs,EJBs there will be problem while MARSHALLING and UNMARSHALLING thats what i already Faced......
So i need some other solution if u have any PL let me know.....
But Anyhow Thanks for ur reply....
Bye,
Prashanth.
-
How to return a ResultSet from an BeanManaged Entity Bean[ Go to top ]
- Posted by: Kiran Patchigolla
- Posted on: December 29 2000 23:55 EST
- in response to Prashanth Karre
That's because a ResultSet is not a serializable object. You have to either convert it to a collection object or use something like CachedRowSet... I never done the second option but there are 100 different threads on theserverside.com that address this very same issue...
Kiran. -
How to return a ResultSet from an BeanManaged Entity Bean[ Go to top ]
- Posted by: Doan LyDuc
- Posted on: January 01 2001 01:51 EST
- in response to Kiran Patchigolla
I have done with how to pass result set to the client in the session bean. But for the Entity, my question is why you want to pass a result set.
However if you want to pass a result set to the client, here is the code wich I have implemented and it is worked fine:
This method is implemented in the bean class:
public CachedRowSet getAllRecs() throws Exception {
CachedRowSet crs=new CachedRowSet();
try
{
String sql_query="SELECT Ccy,CcyNm FROM "+
DatabaseNames.ECURRENCY_TABLE+
" ORDER BY Ccy";
instrum_connection=getConnection();
Statement stmt=instrum_connection.createStatement();
ResultSet rs=stmt.executeQuery(sql_query);
crs.populate(rs);
rs.close();
stmt.close();
instrum_connection.close();
}
catch (Exception e)
{
System.err.println("getAllRec function"+e.toString());
}
return crs;
}
To this: you must download the rowset.jar file from java.sun.com and set it to your class path of the application server and your client machine.
Any more question about this you mail for me at: lddoan99 at yahoo dot com
Hope this will help.
Doan