tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea.Ferra...@marconiselenia.com
Subject Problem with oracle CLOB and connection pooling
Date Thu, 09 Jan 2003 09:52:17 GMT
Hi all
I've got a problem reading oracle.sql.CLOB with connection pooling of
tomcat.
The Connection c is given by tomcat connectio pooling and work well with
everything, but if I try to read a CLOB  field  it gives me a cast
exception.
Here it is java code of reading table class :
      ...
    Statement st = c.createStatement();
    ResultSet rs = st.executeQuery("select  str, clob from table");
    rs.next();
    System.out.println("str= "+rs.getString(str));
    System.out.println("clob= "+rs.getObject(clob));
    oracle.sql.CLOB cl = (oracle.sql.CLOB) rs.getObject(clob);
...
Here  it is the catalina.out:

str= ciao
clob= oracle.sql.CLOB@caea19
java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at
it.marconimobile.businessapplication.portale.servlet.ControlMotion.start(MainServlet.java:112)
      at
it.marconimobile.businessapplication.portale.servlet.ControlMotion.<init>(MainServlet.java:50)
      at
it.marconimobile.businessapplication.portale.servlet.MainServlet.generalResponse(MainServlet.java:39)
      at
it.marconimobile.businessapplication.portale.servlet.MainServlet.doPost(MainServlet.java:32)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
      at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
      at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
      at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
      at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.ClassCastException: oracle.sql.CLOB
      at
it.marconimobile.businessapplication.portale.application.macaddress.ado.NoteADO.getAllRecordFromId(NoteADO.java:68)
      at
it.marconimobile.businessapplication.portale.application.macaddress.InserisciNota.start(InserisciNota.java:59)
      at
it.marconimobile.businessapplication.portale.application.macaddress.pjb.MainPortalClass.start(MainPortalClass.java:69)
      ... 39 more

What is the problem?

Thans in advance for the collaboration
Andrea



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message