| Author |
issue typecasting java.sql.CallableStatement into oracle.jdbc.driver.OracleCallableStatement
|
nandini lagunia
Ranch Hand
Joined: May 05, 2009
Posts: 57
|
|
Hi,
I have written a test class in which I've typecasted java.sql.CallableStatement into oracle.jdbc.driver.OracleCallableStatement and it's works fine.
the code is:-
When I put the code in an ejb business method and invoke the method, it throws java.lang.ClassCastException at line #456
I don't have any clue why it's behaving like this. Will anybody help me???
Thanks in advance.
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
|
Do you get a OracleCallableStatement compatible object from your con.prepareCall()?
|
OCUP UML fundamental
ITIL foundation
|
 |
nandini lagunia
Ranch Hand
Joined: May 05, 2009
Posts: 57
|
|
Hi,
The same piece of code works fine in the standalone utilty.
OracleCallableStatement interface implements java.sql.CallableStatement()here so we can very well
go for explicit casting.
Don't you think so?
|
 |
nandini lagunia
Ranch Hand
Joined: May 05, 2009
Posts: 57
|
|
|
con.prepareCall() returns java.sql.CallableStatement.
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
Do you know the exact class that it returns in your case,
both for the standalone and not so standalone use case?
you can use the getName() method on cs in both cases. Wonder if there is a difference in the two cases...
|
 |
 |
|
|
subject: issue typecasting java.sql.CallableStatement into oracle.jdbc.driver.OracleCallableStatement
|
|
|