Announcement Announcement Module
Collapse
No announcement yet.
Passing xmltype from Spring stored procedure class to Oracle Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing xmltype from Spring stored procedure class to Oracle

    Hi,
    I have a Oracle stored procedure written in 11g which takes xml as i/p

    create or replace
    PROCEDURE "XDATA"
    (
    inXDATA IN SYS.XMLTYPE,
    outStatus OUT varchar2)
    AS
    BEGIN
    INSERT INTO SPZN.testXML(XDATA) VALUES(inXDATA);
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
    outStatus := SUBSTR(SQLERRM, 1, 200);
    END XDATA;
    }

    Iam trying to pass xml data using the below code to set xml and declare xml

    inParams.put("inXDATA",
    new SqlTypeValue() {
    @Override
    public void setTypeValue(PreparedStatement arg0, int arg1,
    int arg2, String arg3) throws SQLException {
    // TODO Auto-generated method stub
    ((OracleCallableStatement )arg0).setObject(1, new XMLType(arg0.getConnection(), "<product>prospects</product>"));
    }
    });

    //execution of stored procedure
    outParams = execute(inParams);

    declareParameter(new SqlParameter("inXDATA",Types.OTHER));

    Iam getting the following exception when i execute

    com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with oracle.jdbc.OracleConnection

    Please suggest and advise on how to procede with xml insertion. Any help in this regard will be greatly appreciated.

    Thanks,
    Raghuram.

  • #2
    Try setting a NativeJdbcExtractor on the template -- http://static.springsource.org/sprin...bcExtractor%29

    In this case I'd try using a WebSphereNativeJdbcExtractor -- http://static.springsource.org/sprin...Extractor.html

    Comment

    Working...
    X