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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only

Unable to get oracle.sql.STRUCT from a jdbc pool connection

  • 1.  Unable to get oracle.sql.STRUCT from a jdbc pool connection

    Posted 01/31/11 03:47 PM

    Hi, im trying to pass a multidimensional Array from a Java service to Oracle, getting the connection from a ServiceExecute adapter. Everything works fine when i create a new connexion in the Java Service, but when i get the connection from the pool i get a ClassCastException . Here are my code:

    IDataCursor pipelineCursor = pipeline.getCursor();
    java.sql.Connection conn = null;
    try
    {
    //the pool connection
    //conn = (java.sql.Connection)IDataUtil.get(pipelineCursor, “$db_service_connection”);
    //creating new connection – works fine
    //conn = java.sql.DriverManager.getConnection(“jdbc:oracle:thin:@server:port:sid”, “username”, “password”);

    Object anArrayIn = new Object[1];
    for (int i=0; i<dParametros.length; i++) {
    String nombreParam = “”;
    IDataCursor idcItem = dParametros[i].getCursor();

        idcItem.first("nombre"); 
    nombreParam  = (String)idcItem.getValue(); 
    
    [color="red"]anArrayIn[i] = new oracle.sql.STRUCT (new oracle.sql.StructDescriptor("T_PARAMETRO_LV_TW",conn),conn,new String[]{nombreParam,valorParam,tipoParam});[/color]
    

    //Exception line
    }


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