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

Convert a string to CLOB

  • 1.  Convert a string to CLOB

    Posted Tue September 27, 2005 05:40 AM

    We have a large string that needs to be saved in the database. The database tables are created with the CLOB object.

    We are using a JDBC adapter. The adapter service fails with a Service exception, when the string is directly mapped. (Error Message : The input data for the FIELD “longText” is not “java.sql.Clob”

    What type of typecasting must be done to achieve a clob object from a string.

    TIA !
    BS


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


  • 2.  RE: Convert a string to CLOB

    Posted Tue September 27, 2005 10:30 AM

    You have to create a CLOB object and put your string data into it. Simple Casting will not work in this case to my knowledge.
    Depending on what DB you are using SQL, Oracel, DB2 or others creating a CLOB object will be DB dependent and cahlanging. Depending on DB it can be convoluted. Forexample DB2 provides a rather simple Factory to craete your CLOB objects and you can fill them with your data later. Oracle has similar but requires active DB connection and Java code to imlpement it. In any case you likely to need to create Java service to create java.sql.Clob object from your string before you map it in JDBC adapter service.


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