Je suis une erreur face à weblogic:weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY ne peut pas être jeté à oracle.sql.ARRAY
java.lang.ClassCastException: weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY cannot be cast to oracle.sql.ARRAY at weblogic.jdbc.wrapper.CallableStatement_oracle_jdbc_driver_OracleCallableStatementWrapper.getARRAY(Unknown Source)
code:
public String[] methodName(String[] P1,String P2,String P3,String P4, String P5,int Sessioninfo)
{
Connection conn = null;
CallableStatement cstmt = null;
ResultSet rs = null;
String[] returnArray = null;
try {
ds=getDataSource(Sessioninfo);
conn = ds.getConnection();
conn = new CommonsDbcpNativeJdbcExtractor().getNativeConnection(conn);
conn.setAutoCommit(false);
ArrayDescriptor oracleVarchar2Collection =
ArrayDescriptor.createDescriptor("VARRAY_PARTS",conn);
ARRAY sqlNos = new ARRAY(oracleVarchar2Collection, conn, P1);
cstmt =conn.prepareCall("{call Procedure1(?,?,?,?,?,?)}");
cstmt.setObject(1, sqlNos);
cstmt.setString(2, P2);
cstmt.setString(3, WebpartsUtility.convertSQLStringIN(P3,","));
cstmt.setString(4, WebpartsUtility.convertSQLStringIN(P4,","));
cstmt.setString(5,P5);
cstmt.registerOutParameter(6,OracleTypes.ARRAY, "VARRAY_PARTS");
cstmt.setFetchSize(2500);
cstmt.execute();
ARRAY mainArray = ((OracleCallableStatement)cstmt).getARRAY(6);
returnArray = (String[]) mainArray.getArray();
} catch (SQLException ex) {
logger.fatalMsg("Sql Exception Occured :: "+ex.getMessage(),ex);
} catch (Exception ex) {
logger.fatalMsg("Exception Occured :: "+ex.getMessage(),ex);
} finally {
try {
if (cstmt != null) {
cstmt.close();
cstmt = null;
}
if (conn != null) {
conn.close();
conn = null;
}
if (ds != null) {
ds = null;
}
} catch (SQLException ex) {
logger.fatalMsg("Sql Exception Occured :: "+ex.getMessage(),ex);
} catch (Exception ex) {
logger.fatalMsg("Exception Occured :: "+ex.getMessage(),ex);
}
}
return returnArray;
}
Il est bon de poster des messages et le code d'erreur, si vous avez une idée de ce qu'il pourrait être, il est bon à poster ça aussi. –