Hola amigos,
Finalmente pude resolver el problema, al parecer hacer un OracleCallableStatement.getConnection() es el que me brinda una conexion satisfactoria para el ArrayDescriptor y no arroje el ClassCastException, les incluyo el código modificado, por si hay alguien que desee pasar un Array como parámetro.
public String getCalculaCantidadesReservasVenta(Long codPedidoVenta,
double[] cantSolicitadas, long[] codDetalles, String codFilial)
throws Exception {
OracleCallableStatement cstmt = null;
String mensaje = "";
try {
logger.debug("En el inicio getCalculaCantidadesReservasVenta");
// ////////////////////////////////////////////////////////////
StringBuffer consulta = new StringBuffer(
" call REP_RESERVA_CANTIDADES_VENTA(?, ?, ?, ?, ?) ");
logger.debug(" SQL ::>>" + consulta.toString
());
int i = 1;
cstmt = (OracleCallableStatement) getSession().connection().prepareCall( consulta.toString() );
ArrayDescriptor descCS = ArrayDescriptor.createDescriptor
(
"REPUESTOS.NUMBER_NT",
cstmt.getConnection());
ARRAY arrayCS = new ARRAY(descCS,
cstmt.getConnection(), cantSolicitadas);
ArrayDescriptor descCD = ArrayDescriptor.createDescriptor(
"REPUESTOS.NUMBER_NT",
cstmt.getConnection());
ARRAY arrayCD = new ARRAY(descCD,
cstmt.getConnection(), codDetalles);
logger.debug("Despues de crear los arrays");
cstmt.setLong(i++, codPedidoVenta != null ? codPedidoVenta.longValue() : 0);
cstmt.setARRAY(i++, arrayCS);
cstmt.setARRAY(i++, arrayCD);
cstmt.setString(i++, codFilial);
((CallableStatement)cstmt).registerOutParameter(i, Types.VARCHAR);
cstmt.executeUpdate();
mensaje = cstmt.getString(i);
logger.debug("Mostrando el mensaje::: " + mensaje);
} catch (Exception e) {
logger.error(e);
e.printStackTrace();
throw new Exception(e);
} finally {
try {
cstmt.close();
cstmt = null;
} catch (Exception ignore) {
ignore.printStackTrace();
}
}
return mensaje;
}
Y ya con esto recibo mi array en el Oracle donde lo proceso como el NESTED TABLE que cree como TYPE.
Se acepta cualquier sugerencia y/o observación.
Saludos,