[英]Cannot pass array to stored procedure in oracle
I am getting following error when I pass array to stored procedure. 将数组传递给存储过程时,出现以下错误。
java.lang.ClassCastException: weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection cannot be cast to oracle.jdbc.driver.OracleConnection
java.lang.ClassCastException:weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection无法转换为oracle.jdbc.driver.OracleConnection
I am using Spring MVC with oracle 10g on Weblogic 11g server. 我在Weblogic 11g服务器上将Spring MVC与oracle 10g一起使用。 I do a JNDI look up to connect to database.
我做一个JNDI查找连接到数据库。 I also unchecked the Wrap data types check box in my Data sources configuration on weblogic server and restarted server.
我还取消了在weblogic服务器和重新启动的服务器上的“数据源”配置中的“包装数据类型”复选框的复选框。 But still same error.
但是还是一样的错误。
I am using ojdbc6-11.2.0.3.jar 我正在使用ojdbc6-11.2.0.3.jar
Following is the like of code where I get the error 以下是我收到错误的代码
ArrayDescriptor arrayDescriptor =
ArrayDescriptor.createDescriptor("Frc.Typ_Frc_Varray",
(oracle.jdbc.driver.OracleConnection) dataSource.getConnection());
I have data source autowired as follows 我的数据源自动接线如下
@Autowired
DataSource dataSource;
尝试像这样进行转换:
(oracle.jdbc.driver.OracleConnection) ((WLConnection)dataSource.getConnection()).getVendorConnection()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.