DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27162>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27162

SQL task doesn't work with Informix IDS 9.2

           Summary: SQL task doesn't work with Informix IDS 9.2
           Product: Ant
           Version: 1.6.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Any SQL statement I try to execute using <sql> task fails reporting

  C:\x\veve\build.xml:12: java.sql.SQLException: Method can be called only once.

Prior ant 1.6.0 everything worked fine. Now we cannot move from 1.5.4 to 1.6.x.

I guess it's due to the following broken code in
org.apache.tools.ant.taskdefs.SQLExec.execSql() method:

    ...
    ret = statement.getMoreResults();
    updateCount = statement.getUpdateCount();
    resultSet = statement.getResultSet();
  } while (ret);

The Informix JDBC driver refuses to perform getUpdateCount() method if the 'ret'
is false.

The fix is very simple - just to test 'ret' before calling updateCount():

    ...
    ret = statement.getMoreResults();
    if (ret) {
      updateCount = statement.getUpdateCount();
      resultSet = statement.getResultSet();
    }
  } while (ret);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to