我有一个关于投射CallableStatement
到的问题OracleCallableStatement
。它给出了ClassCastException
这样的:
java.lang.ClassCastException:
oracle.jdbc.driver.OracleCallableStatementWrapper cannot be cast to
oracle.jdbc.driver.OracleCallableStatement
代码是:
Connection conn = qdbDataSource.getConnection();
PreparedStatement pstmt = null;
Connection conn2 = ((WLConnection)conn).getVendorConnection();
try {
CallableStatement cs = conn2.prepareCall("{ ?=call asr.bsc(?,?,?,?,?,?,?)}");
OracleCallableStatement ocs = (OracleCallableStatement)cs;
// (...)
}
我尝试使用 spring jdbc 模板,但结果是一样的。
我使用的是 WebLogic 10.3.2,数据源的驱动程序类是默认的。我也在ojdbc14.jar
我的项目中使用,启动类路径不包括它。
有任何想法吗?
编辑:这些是运行时包装类的子类:
weblogic.jdbc.wrapper.CallableStatement_oracle_jdbc_driver_OracleCallableStatementWrapper class
weblogic.jdbc.wrapper.CallableStatement class
weblogic.jdbc.wrapper.PreparedStatement class
weblogic.jdbc.wrapper.Statement class
weblogic.jdbc.wrapper.JDBCWrapperImpl class
weblogic.utils.wrapper.WrapperImpl class java.lang.Object