webMethods

webMethods

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
  • 1.  Pass Array to JDBC Adapter

    Posted Mon May 09, 2011 12:30 PM

    Hi All,

    I’m trying to pass an array to the JDBC adapter. The input type is ARRAY (input field type java.sql.Array).

    I’m trying to map String list to JDBC input or mapping object list to JDBC input in both cases it’s throwing following exception.

    [ADA.1.340] The input data for field “empIds” is not “java.sql.Array”.
    java.lang.String cannot be cast to java.sql.Array

    I’ve written very simple custom SQL just trying to pass employee ids as string type.

    SELECT e.empName from Employee e where e.empNo in (?)

    So please could anyone help in mapping string list to java.sql.Array?


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


  • 2.  RE: Pass Array to JDBC Adapter

    Posted Tue May 10, 2011 10:08 AM

    Somewhere in the JDBC Adapter user guide I read ‘The WHERE clause does not support the java.sql.Array data type’ and java.sql.Array or java.sql.Struct can be used as output field type for a database column of type array or struct only.


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


  • 3.  RE: Pass Array to JDBC Adapter

    Posted Mon May 16, 2011 04:52 PM

    Hi,
    I guess this could be resolved using a java service something like this…

    java.sql.Array sqlArray = null;

    try {
    Class.forName(driver).newInstance();
    conn = DriverManager.getConnection(url,userName,password);
    sqlArray=conn.createArrayOf(“NUMBER”, content);
    IDataCursor pipelineCursor_1 = pipeline.getCursor();
    IDataUtil.put( pipelineCursor_1, “sqlarray”, sqlArray );
    pipelineCursor_1.destroy();

        conn.close();
    } catch (Exception e) {
    IDataUtil.put( pipelineCursor, "noconn", e);
    }
    

    The output sqlArray could be mapped to the adapter service input.

    Regards,
    Amol.


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


  • 4.  RE: Pass Array to JDBC Adapter

    Posted Mon September 03, 2012 05:57 PM

    I have the same question but the response don’t work for me!
    I don’t understant why i need a connection for have a java.sql.Array? It’s the only way?


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