IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

problem inserting xmlData CLOB data in to oracle 9i database

  • 1.  problem inserting xmlData CLOB data in to oracle 9i database

    Posted Thu December 21, 2006 07:00 AM

    Hi ,

    i have created the Connection using thin type driver,my database oracle 9 i ,i have created the insert adapter service using the connection table have the CLOb Data Type for this filed i have given string filed as a input type

    in flow service convert the documet to XML String using documentToXMLString service and called the above insert adapter service and passed the XML data to CLOB datatype.

    if i run the flow service given below error

    com.wm.pkg.art.error.DetailedServiceException: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service Test.AnilE.inserttClobTest:insertClob.
    [ADA.1.316] Cannot execute the SQL statement “INSERT INTO TEST_CLOB(ID, DOCUMENT_NAME, XML_DOCUMENT, TIMESTAMP) VALUES (?, ?, ?, ?)”. "
    (72000/1461) ORA-01461: can bind a LONG value only for insert into a LONG column
    "
    ORA-01461: can bind a LONG value only for insert into a LONG column

    at com.wm.pkg.art.error.DetailedServiceException.create(DetailedServiceException.java:125)
    at com.wm.pkg.art.error.DetailedServiceException.create(DetailedServiceException.java:116)
    at com.wm.pkg.art.error.DetailedServiceException.create(DetailedServiceException.java:103)
    at com.wm.pkg.art.ns.AdapterServiceNode.invokeService(AdapterServiceNode.java:649)
    at com.wm.pkg.art.ns.ARTNSService.baseInvoke(ARTNSService.java:47)
    at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:351)
    at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:153)
    at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
    at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:577)
    at com.wm.lang.flow.FlowState.stepIncremental(FlowState.java:491)
    at com.wm.lang.flow.FlowState.invoke(FlowState.java:373)
    at wm.server.flowimpl.stepFlow(flowimpl.java:183)
    at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:294)
    at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:351)
    at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:119)
    at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:167)
    at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:204)
    at com.wm.util.pool.PooledThread.run(PooledThread.java:105)
    at java.lang.Thread.run(Thread.java:534)
    

    can anybody help me how to insert XML Data in CLOb Filed ,whithout mapping XML Data to CLOB filed od adapter service all data is inserting sucessfully,if i map the XML Data String to CLOB Column of DB table giving Errror

    pls Help me on this problem to rectify the problem.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 2.  RE: problem inserting xmlData CLOB data in to oracle 9i database

    Posted Wed December 27, 2006 01:10 AM

    here i Decided to go for Javaservice for converting String to the CLOB Object

    i Adapter service i thought to keep java.sql.CLOB as a inputType, map the output of javaservice to this adapter service filed

    than i started java service below is java code

    IDataCursor datacursor =pipeline.getCursor();
    String data=IDataUtil.getString(datacursor,“string”);

    long l=0;
    oracle.sql.CLOB clobdocument=null;

    try
    {
    //int in=clobdocument.setString(l,data);
    Writer wr=clobdocument.setCharacterStream(l);
    BufferedWriter br = new BufferedWriter(wr);
    StringReader strrd=new StringReader(data);
    char aux;
    do{
    aux=(char)strrd.read();
    br.write(aux);
    }while(aux != -1);

    }catch(Exception e)
    {
    throw new ServiceException (“Canot convert CLOB To String”+e.toString());
    }
    datacursor.insertAfter(“CLOBData”,clobdocument);
    datacursor.destroy();

    if i run this service giving below Error

    Could not run ‘convertCLOB’.

    java.lang.reflect.InvocationTargetException: oracle.sql.CLOB.setCharacterStream(J)Ljava/io/Writer;

    i think problem in javaservice is not instatiated the CLOB ,i canot instatitate the CLOb becuase it is an interface.

    pls provide me suggestion to convert string(XML Data ) to CLOB Object…


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards