File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes CLOB ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "CLOB ClassCastException" Watch "CLOB ClassCastException" New topic

CLOB ClassCastException

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
I have a DAO inserting a operating on a CLOB column. The method works fine when run standalone but when I use it inside weblogic 8.1 it throws ClassCastException.

Appreciate any pointers. Thanks
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
no you cannot type cast a parent into child, while parent is having the reference of itself.

though, dont know if there is some parent and child relation or not.
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
thats the way to insert the CLOB value and it does work when run standalone. It was only creating problems while run in weblogic.

The problem is that
Clob xmlClob= rs.getClob(1) ;

is supposed to return java.sql.Clob but its returning


It worked fine when I casted it to weblogic CLOB, but i would prefer using oracle.sql.Clob. I dont know how to make weblogic return me the plain java.sql.Clob from the resultset. Any Help?
I agree. Here's the link:
subject: CLOB ClassCastException
It's not a secret anymore!