ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: How to check whether database exists and then proceed ?
Date Fri, 26 Sep 2008 08:18:51 GMT
You could write a Condition.

<condition property="sqlonline">
    <scriptcondition language="javascript">
        // Try your SQL, maybe using <sql> task which implemented
        // in org.apache.tools.ant.taskdefs.SQLExec
        self.setValue( sqlWasOK );	
    </scriptcondition>
</condition> 
<target name="-sql.online" if="sqlonline">
    <echo> Hello Database </echo>
</target>
<target name="-sql.online" unless="sqlonline">
    <echo> Sorry, no Database </echo>
</target>
<target name="sql" depends="-sql.online,-sql.offline"/>


Jan

>-----Urspr√ľngliche Nachricht-----
>Von: Kothari, Shivani [mailto:skothari@inteqnet.com] 
>Gesendet: Freitag, 26. September 2008 09:33
>An: Ant Users List
>Betreff: RE: How to check whether database exists and then proceed ?
>
>Hi thanks rebhan
>I did the same only, why I raised this question in email is to find out
>..if there is any better approach then doing this....
>
>Thanks
>skothari
>
>-----Original Message-----
>From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
>Sent: Friday, September 26, 2008 1:00 PM
>To: 'Ant Users List'
>Subject: RE: How to check whether database exists and then proceed ?
>
>
>
>
>-----Original Message-----
>From: Kothari, Shivani [mailto:skothari@inteqnet.com]
>Sent: Friday, September 26, 2008 9:19 AM
>To: Ant Users List; Jan.Materne@rzf.fin-nrw.de
>Subject: RE: How to check whether database exists and then proceed ?
>
>/*
>Hi,
>Prob is I want to proceed further in the build script....in both the
>cases  If db doesnot exists then prompt the user and continue 
>the script
>and if does continue the script
>
>*/
>
>AFAIK, the sql task has no errorproperty like f.e. the java task,so you
>can't do stuff like that =
>
><sql ... errorproperty="${sqlfailure} ..... >
>
><target name="promptuser" if="sqlfailure">
>...
>
>
>but you may use the <sql onerror="fail"> within a <try> <catch>
>construct.
>
>try / catch is part of the antcontrib task suite, see =
>http://ant-contrib.sourceforge.net/tasks/tasks/trycatch.html
>
>download=
>http://sourceforge.net/project/showfiles.php?group_id=36177&pac
>kage_id=2
>8636
>
>pick Version 1.0b2 or 1.0b3
>
>
>Regards, Gilbert
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message