You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Pankaj Arora01 <Pa...@infosys.com> on 2007/04/03 07:10:50 UTC

Trapping ORA errors in ANT

Hi 

 

I am developing my own tasks which extend from ExecTask of ANT.

I have developed SQLPlustask but I am facing an issue in the same.

 

I need to provide functionality of Option of terminating the build
process if some ORA error is thrown.

Ant method setFailIfExecutionFails() does not catches ORA error &
neither I am able to get the return code of the executable statement.

I tried reading the error stream of the Process that is executed but
couldn't find any method through which I can access the error stream.

 

Any pointers in this regard would be highly appreciated.

 

 

Regards, 

Pankaj

 

 

 

 



**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Re: Trapping ORA errors in ANT

Posted by Andrew Goktepe <an...@gmail.com>.
I have done this by using the sqlplus task from Incanto (
http://incanto.sourceforge.net/usage-sqlplus.html) with failonerror=true and
the statement WHENEVER SQLERROR EXIT FAILURE ROLLBACK at the top of the SQL
scripts being run. This will cause any ORA error to halt sqlplus, thus
failing the Ant task call. This is useful if you want to always fail on any
ORA error.

-Andrew

On 4/3/07, Karr, David <da...@wamu.net> wrote:
>
> I also crossed this road, and I ended up using Jakarta Jelly to do this.
> It gives me specific Oracle errors, and it allows me to write more of a
> script, with reusable values and methods.
>
> > -----Original Message-----
> > From: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com]
> > Sent: Monday, April 02, 2007 10:11 PM
> > To: user@ant.apache.org
> > Subject: Trapping ORA errors in ANT
> >
> >
> > Hi
> >
> >
> >
> > I am developing my own tasks which extend from ExecTask of ANT.
> >
> > I have developed SQLPlustask but I am facing an issue in the same.
> >
> >
> >
> > I need to provide functionality of Option of terminating the
> > build process if some ORA error is thrown.
> >
> > Ant method setFailIfExecutionFails() does not catches ORA
> > error & neither I am able to get the return code of the
> > executable statement.
> >
> > I tried reading the error stream of the Process that is
> > executed but couldn't find any method through which I can
> > access the error stream.
> >
> >
> >
> > Any pointers in this regard would be highly appreciated.
> >
> >
> >
> >
> >
> > Regards,
> >
> > Pankaj
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > **************** CAUTION - Disclaimer ***************** This
> > e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION
> > intended solely for the use of the addressee(s). If you are
> > not the intended recipient, please notify the sender by
> > e-mail and delete the original message. Further, you are not
> > to copy, disclose, or distribute this e-mail or its contents
> > to any other person and any such actions are unlawful. This
> > e-mail may contain viruses. Infosys has taken every
> > reasonable precaution to minimize this risk, but is not
> > liable for any damage you may sustain as a result of any
> > virus in this e-mail. You should carry out your own virus
> > checks before opening the e-mail or attachment. Infosys
> > reserves the right to monitor and review the content of all
> > messages sent to or from this e-mail address. Messages sent
> > to or from this e-mail address may be stored on the Infosys
> > e-mail system.
> > ***INFOSYS******** End of Disclaimer ********INFOSYS***
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

RE: Trapping ORA errors in ANT

Posted by "Karr, David" <da...@wamu.net>.
I also crossed this road, and I ended up using Jakarta Jelly to do this.
It gives me specific Oracle errors, and it allows me to write more of a
script, with reusable values and methods. 

> -----Original Message-----
> From: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com] 
> Sent: Monday, April 02, 2007 10:11 PM
> To: user@ant.apache.org
> Subject: Trapping ORA errors in ANT
> 
> 
> Hi 
> 
>  
> 
> I am developing my own tasks which extend from ExecTask of ANT.
> 
> I have developed SQLPlustask but I am facing an issue in the same.
> 
>  
> 
> I need to provide functionality of Option of terminating the 
> build process if some ORA error is thrown.
> 
> Ant method setFailIfExecutionFails() does not catches ORA 
> error & neither I am able to get the return code of the 
> executable statement.
> 
> I tried reading the error stream of the Process that is 
> executed but couldn't find any method through which I can 
> access the error stream.
> 
>  
> 
> Any pointers in this regard would be highly appreciated.
> 
>  
> 
>  
> 
> Regards, 
> 
> Pankaj
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> 
> **************** CAUTION - Disclaimer ***************** This 
> e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION 
> intended solely for the use of the addressee(s). If you are 
> not the intended recipient, please notify the sender by 
> e-mail and delete the original message. Further, you are not 
> to copy, disclose, or distribute this e-mail or its contents 
> to any other person and any such actions are unlawful. This 
> e-mail may contain viruses. Infosys has taken every 
> reasonable precaution to minimize this risk, but is not 
> liable for any damage you may sustain as a result of any 
> virus in this e-mail. You should carry out your own virus 
> checks before opening the e-mail or attachment. Infosys 
> reserves the right to monitor and review the content of all 
> messages sent to or from this e-mail address. Messages sent 
> to or from this e-mail address may be stored on the Infosys 
> e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> 

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