ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: AW: How to silence errors in SQL task or log
Date Wed, 21 Mar 2007 15:12:08 GMT
ok, another idea: modify <sql>

- subclass SQLExec
- overwrite execSQL(String sql, PrintStream out)
  -- copy the implementation from SQLExec
  -- add your logging

then do a <taskdef name="sql2"...> and use that.

It seems that you are interesting in redirecting that part:

            SQLWarning warning = conn.getWarnings();
            while (warning != null) {
                log(warning + " sql warning", Project.MSG_VERBOSE);
                warning = warning.getNextWarning();


>-----Ursprüngliche Nachricht-----
>Von: Hans Schwaebli [] 
>Gesendet: Mittwoch, 21. März 2007 15:51
>An: Ant Users List
>Betreff: Re: AW: How to silence errors in SQL task or log
>You didn't test the ideas. But I have, at least a)
>  No, a) does not work because the error is not redirected but doubled!
>  b) sounds too complicated.
> wrote:
>  Just some ideas ...
>b) custom Logger
>- if a special output comes, it starts/ends logging
>- special output could be done with 
>>-----Ursprüngliche Nachricht-----
>>Von: Hans Schwaebli [] 
>>Gesendet: Mittwoch, 21. März 2007 14:35
>>An: Ant Users List
>>Betreff: Re: How to silence errors in SQL task or log
>>Internal, external ... didn't matter for my question. There is 
>>a error stream which I would like to conveniently redirect. 
>>The easiest thing is in the Ant script itself. In one SQL call 
>>I want to redirect it, in another not. Setting SQL level 
>>globally to info would not fit. There are still ways to do it, 
>>but they add even more complexity with all its side effects.
>>  If I decide to continue the SQL script in case of an error, 
>>it would be nice if Ant by default would not print the error 
>>stream then.
>>  Okay, another case where I didn't overlook anything and now 
>>know that it is digging in the dirt deeply because of 
>">>design" stuff. Its not just Ant, but CruiseControl, CVS and 
>>other stuff with such things.
>>Steve Loughran wrote:
>> Hans Schwaebli wrote:
>>> Can anybody tell my why cannot be used for the SQL task?
>>because sql task is not executing an external program
>>> I want to silence the errors if they occur when running the 
>>SQL task. But it didn't work. Any solution? Best would be to 
>>log all errors of a certain SQL task on info level. This 
>>flexibility I am missing.
>>log through log4j and set your log4j properties file to log 
>sql errors 
>>at info level?
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
>>Be a PS3 game guru.
>>Get your game face on with the latest PS3 news and previews at 
>>Yahoo! Games.
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>Bored stiff? Loosen up...
>Download and play hundreds of games for free on Yahoo! Games.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message