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:[EMAIL PROTECTED]
>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:[EMAIL PROTECTED]
>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:[EMAIL PROTECTED]
>Sent: Friday, September 26, 2008 9:19 AM
>To: Ant Users List; [EMAIL PROTECTED]
>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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]