thingol 4 de ago. de 2009
Qual é o erro que ele mostra? Normalmente a mensagem já é uma boa pista. Se porventura ele mostrar algo enigmático como:
OracleConnection can not be cast to OracleConnection
ou coisa parecida, é problema de classloader, e você precisa ver onde é que tem de pôr o ojdb14.jar.
Se for outra coisa, então você precisa tomar outra providência.
thingol 4 de ago. de 2009
As pessoas normalmente têm esse problema. Quando ele ocorre (veja thread abaixo), é necessário consertá-lo como fez o Ravi na resposta que você vai procurar na thread.
http://forums.oracle.com/forums/thread.jspa?messageID=2385275
Take a look at this blog. You will see a step by step example.
http://ravivedala.blogspot.com/2008/03/oracle-10g-passing-arrays-to-database.html
The nightmare exception for Java/Oracle developers
java.lang.ClassCastException: oracle.jdbc.driver.T4CConnection cannot be cast to oracle.jdbc.OracleConnection
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:149)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115)
…
Solution :
a)You will see the above exception, if you have ojdbc14.jar in your war file. You would be having ojdbc14.jar on your classpath for compiling your java classes. Use it only for compilation. Don’t include it in the build to Tomcat. ie., the war file of your web app should NOT have ojdbc14.jar in it.
b) Make sure that the Oracle thin driver (eg : ojdbc14.jar) is in tomcat’s common\lib.
Good Luck !!
r-a-v-i