I use Clover GUI create a DB Execute component, and input follow sql sentence into the SQL code property:
select * from organ_level;
select * from log_runlog;
The graph source like this:
<Node enabled="enabled" id="DB_EXECUTE0" type="DB_EXECUTE">
<attr name="SQLCode">select * from organ_level;
select * from log_runlog;</attr>
</Node>
When I run the graph ,it always throw a RuntimeException ("Can't find <SQLCode> node !")
My Clover GUI version is 1.3, Clover version is 1.8.1
              select * from organ_level;
select * from log_runlog;
The graph source like this:
<Node enabled="enabled" id="DB_EXECUTE0" type="DB_EXECUTE">
<attr name="SQLCode">select * from organ_level;
select * from log_runlog;</attr>
</Node>
When I run the graph ,it always throw a RuntimeException ("Can't find <SQLCode> node !")
My Clover GUI version is 1.3, Clover version is 1.8.1
- 
                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
- 
                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.
 
                      
Comments 2