Announcement Announcement Module
No announcement yet.
Cannot Process oracle.sql.ARRAY in SqlOutParameter Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot Process oracle.sql.ARRAY in SqlOutParameter

    Hi, I am having trouble fetching an oracle.sql.ARRAY type into a JPublisher generated variable that I pass in through SqlOutParameter. I am however able to successfully process oracle.sql.STRUCT types. The classes get populated with values returned by the stored procedured for this type.

    For oracle.sql.ARRAY, I am having to process the base type by cycling thru each element manually. Is there anyway it can be achieved automatically as in oracle.sql.STRUCT.

    Here is the mapping code I specify for oracle.sql.ARRAY

    declareParameter(new SqlOutParameter("x_order_line_tab",
    OracleTypes.ARRAY, "XXVS_LINE_TBL_TYPE",
    new SqlReturnType() {
    public Object getTypeValue(CallableStatement cs,
    int paramIndex, int sqlType, String typeName)
    throws SQLException {
    Connection con = cs.getConnection();
    Map typeMap = con.getTypeMap();
    typeMap.put(typeName, LineTblType.class);
    Object o = cs.getObject(paramIndex);
    return o;