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 java.lang.ClassCastException: oracle.sql.CLOB 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 "java.lang.ClassCastException: oracle.sql.CLOB" Watch "java.lang.ClassCastException: oracle.sql.CLOB" New topic

java.lang.ClassCastException: oracle.sql.CLOB

Firas Najjar

Joined: Nov 22, 2005
Posts: 3
I am getting this error when I try to use oracle.sql.CLOB
Any help would be greatly appreciated

Here is my code (Inside

And here is the error I am getting from catalina.out

java.lang.ClassCastException: oracle.sql.CLOB
at mdx.DB.updateClob(
at org.apache.jsp.processEditBidItem_jsp._jspService(org.apache.jsp.processEditBidItem_jsp:174)
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
at org.apache.tomcat.util.threads.ThreadPool$

Thanks in advance

You must be the change you wish to see in the world. Mahatma Gandhi
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Moved to the JDBC forum.

[Asking smart questions] [About Bear] [Books by Bear]
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
Firas Najjar

Joined: Nov 22, 2005
Posts: 3
stu derby, Thanks for your reply.
This code is working on a resin environment; I moved to Tomcat5.5.12 and now
it is not working; it compiles correctly but when I try to use it gives this error.
I am not a JSP/JAVA expert and I did not write this code I just want it to work.
I am sure that the code in the link you send to is great but it will take a lot of time to figure it out.
I use this code when I want to insert or update to the Clob field.

Any help would greatly appreciated.
Thank you
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
I think the problem is likely that you don't have the OracleResultSet. Most appservers have proxy classes for the JDBC driver. They don't have a choice in the matter if they want to manage a connection pool. If I'm correct, than that would mean the result set isn't returning an Oracle CLOB, it is returning a Resin wrapper around the Oracle CLOB. Whenever I've hit this problem before its always been because of a proxy class.
[ January 12, 2006: Message edited by: Reid M. Pinchback ]

Reid - SCJP2 (April 2002)
I agree. Here's the link:
subject: java.lang.ClassCastException: oracle.sql.CLOB
It's not a secret anymore!