ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27162] New: - SQL task doesn't work with Informix IDS 9.2
Date Mon, 23 Feb 2004 15:49:08 GMT
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: dev@ant.apache.org
        ReportedBy: bohuslavroztocil@email.cz


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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message