Customer Portal

"Can't find <SQLCode> node !" Error

Comments 2

  • Avatar
    oldforum
    0
    Comment actions Permalink
    You found really bug and your code update is right, thanks.

    For others with current release please use "DB sql code" attribute instead "sql code" attribute.

    OtaSanek
  • Avatar
    oldforum
    0
    Comment actions Permalink
    I modify the org.jetel.component.DBExecute class, add some code then it can be run correct:


    public static Node fromXML(org.w3c.dom.Node nodeXML) {
    ....
    if (xattribs.exists(XML_DBSQL_ATTRIBUTE)) {
    query=xattribs.getString(XML_DBSQL_ATTRIBUTE);
    }else if (xattribs.exists(XML_URL_ATTRIBUTE)){
    query=xattribs.resloveReferences(FileUtils.getStringFromURL(xattribs.getString(XML_URL_ATTRIBUTE)));

    //----------------------- Laq add begin-----------------------------------
    }else if (xattribs.exists(XML_SQLCODE_ELEMENT)){
    query=xattribs.getString(XML_SQLCODE_ELEMENT);
    //-------------------------Laq add end-------------------------------
    }else {//we try to get it from child text node
    childNode = xattribs.getChildNode(nodeXML, XML_SQLCODE_ELEMENT);
    if (childNode == null) {
    throw new RuntimeException("Can't find <SQLCode> node !");
    }
    xattribsChild = new ComponentXMLAttributes(childNode);
    query=xattribsChild.getText(childNode);
    }
    executeSQL = new DBExecute(xattribs.getString(Node.XML_ID_ATTRIBUTE),
    xattribs.getString(XML_DBCONNECTION_ATTRIBUTE),
    query.split(SQL_STATEMENT_DELIMITER));
    ...
    }

Please sign in to leave a comment.