When reading the Blob field in the Oracle database,
Oracle. SQL. Blob blob = (Oracle. SQL. Blob) Rs. getblob (1 );
Java. Lang. classcastexception: Oracle. SQL. clob exception occurs.
Exception information:
Java. Lang. classcastexception: Oracle. SQL. blob
At MDX. DB. updateclob (db. Java: 116)
At org. Apache. jsp. processeditbiditem_jsp. _ jspservice (Org. Apache. jsp. processeditbiditem_jsp: 174)
At org. Apache. Jasper. runtime. httpjspbase. Service (httpjspbase. Java: 97)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 802)
At org. Apache. Jasper. servlet. jspservletwrapper. Service (jspservletwrapper. Java: 319)
At org. Apache. Jasper. servlet. jspservlet. servicejspfile (jspservlet. Java: 314)
At org. Apache. Jasper. servlet. jspservlet. Service (jspservlet. Java: 264)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 802)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 252)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 173)
At org. Apache. Catalina. Core. standardwrappervalve. Invoke (standardwrappervalve. Java: 213)
At org. Apache. Catalina. Core. standardcontextvalve. Invoke (standardcontextvalve. Java: 178)
At org. Apache. Catalina. Core. standardhostvalve. Invoke (standardhostvalve. Java: 126)
At org. Apache. Catalina. Valves. errorreportvalve. Invoke (errorreportvalve. Java: 105)
At org. Apache. Catalina. Core. standardenginevalve. Invoke (standardenginevalve. Java: 107)
At org. Apache. Catalina. connector. coyoteadapter. Service (coyoteadapter. Java: 148)
At org. Apache. Coyote. http11.http11processor. Process (http11processor. Java: 868)
At org. Apache. Coyote. http11.http11baseprotocol $ http11connectionhandler. processconnection (http11baseprotocol. Java: 663)
At org.apache.tomcat.util.net. pooltcpendpoint. processsocket (pooltcpendpoint. Java: 527)
At org.apache.tomcat.util.net. leaderfollowerworkerthread. Runit (leaderfollowerworkerthread. Java: 80)
At org. Apache. tomcat. util. threads. threadpool $ controlrunnable. Run (threadpool. Java: 684)
At java. Lang. thread. Run (thread. Java: 595)
At the beginning, I thought it was really a type conversion exception, followed by a sentence to print the type before conversion
System. Out. println (Rs. getblob (1). getclasss ());
The printed result is Oracle. SQL. Blob,
The driver package of the original class12.jar is replaced with the driver package ojdbc14.jar of oracle10.2.0.1,
The problem has not been solved.
Solution:
Finally, I thought the driver package was repeated,
Find the corresponding driver package under the Common/lib directory of Tomcat, and there is a corresponding driver package in the application. You can only delete one of the packages,
Because the driver package under the Common/lib/directory is used to create a JNDI data source for Tomcat, You cannot delete it. You can only delete the packages in the application, however, after deletion, the program compilation fails. In this case, external reference is made through the-build path of eclilpse, and the application compilation is passed, however, the ojdbc14.jar driver package will not be introduced to the release directory. Try again and solve the problem.
This article from: http://blog.javauu.com/2009/03/235.html