-
1. Re: ClassCastException during getCursor with Oracle...
daorriss Jun 21, 2004 12:58 PM (in response to daorriss)I figured out how to do it.. For posterity I'll post it here...
cst = connection.prepareCall("{call request_list.get_default_request_list (?,?,?)}"); cst.setInt(1, 1); cst.setInt(2, 1); cst.registerOutParameter(3, OracleTypes.CURSOR); cst.execute(); rs = (ResultSet) cst.getObject(3);
Note that using getCursor doesn't work BUT getObject does provided I tell the output parameter it's a oracle cursor.
Go figure - the one thing I didn't try was the way to fix it..
The reason for this is that JBoss called statements are implemented via a WrappedCallableStatement (a JBoss object) and that can't be cast to the OracleCallableStatement (which makes sense after I thought about it a bit). However, you can register the output parameter as an oracle type and then cast *that* to the result set. -
2. Re: ClassCastException during getCursor with Oracle...
berdaimo Mar 8, 2007 6:56 AM (in response to daorriss)Hi !
I got the same probleme, Could you like plz to help me !
I got the following expetion :
java.lang.ClassCastException: $Proxy4 while executing the line :
rs = (ResultSet) myCallableStatement.getObject(2);
It's seems that the connexion that I retrived from the datasource of Jboss descriptor is a proxy ! on the other side when I use the classic connection using :
conn = DriverManager.getConnection(url)
I have no problem ! but I'm constrained tu use the datasource connection
Thank you
Adil -
3. Re: ClassCastException during getCursor with Oracle...
peterj Mar 8, 2007 10:31 AM (in response to daorriss)Are you attempting to access a data source from a standalone client? If so, see http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanIAccessADataSourceFromAClient
-
4. Re: ClassCastException during getCursor with Oracle...
berdaimo Mar 8, 2007 12:01 PM (in response to daorriss)it's not recommended but it's possible under jboss 4 I think !
Is there any solution to get a connection from xxx-ds.xml descriptor ? have you any example using EJB to get this connection from remote Interface ?
Thank you ;)