ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs SQLExec.java
Date Tue, 25 Jul 2000 06:50:18 GMT
bodewig     00/07/24 23:50:17

  Modified:    src/main/org/apache/tools/ant/taskdefs SQLExec.java
  Log:
  Changed the execSQL method. Interbase's JDBC driver will throw an
  SQLException in executeQuery if the query doesn't return a ResultSet.
  
  Revision  Changes    Path
  1.2       +7 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
  
  Index: SQLExec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SQLExec.java	2000/07/24 14:27:13	1.1
  +++ SQLExec.java	2000/07/25 06:50:17	1.2
  @@ -180,7 +180,7 @@
           Statement statement = null;
   
           try{
  -            log("connectiing to " + url, Project.MSG_VERBOSE );
  +            log("connecting to " + url, Project.MSG_VERBOSE );
               conn = DriverManager.getConnection(url, userId, password);
               statement = conn.createStatement();
   
  @@ -227,10 +227,13 @@
       }
   
       /**
  -    * Exec the sql statement.
  -    */
  +     * Exec the sql statement.
  +     */
       private void execSQL(Statement statement, String sql) throws SQLException{
  -        statement.executeQuery(sql);
  +        if (!statement.execute(sql)) {
  +            log(statement.getUpdateCount()+" row affected", 
  +                Project.MSG_VERBOSE);
  +        }
       }
   
   }
  
  
  

Mime
View raw message