[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Need something like WHENEVER SQLERROR EXIT for scripts  XML
Forum Index » Jisql
Author Message
dewwalker

Newbie

Joined: 03/26/2006 14:11:50
Messages: 1
Offline

Hello!

First off, this is an awesome tool and a much needed utility.

I was wondering how hard it would be to add either a flag or a command so that if any Exception occurs when reading a script to stop executing the remainder of the script.

Thanks!

Dan
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 750
Location: Superior, CO, USA
Online

Great idea! - that would be very easy to add. Let me see what I can do.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
idiotjones

Newbie

Joined: 08/16/2010 14:30:47
Messages: 2
Offline

I agree that the tool is very useful, so thanks for writing it. And I'm particularly grateful that you output errors to stderr instead of stdout. The original post here was made a long time ago, so I was wondering: did the idea get shot down? I made a quick change to add this feature as a command-line option (thanks for the source!) and a check for the flag when catching an SQLException that then exits the program, but I'm not confident that my solution is the best solution. Therefore, I would just like to know if this is something that might make it into an official release in the near future. Or am I completely missing something, and it is already available?
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 750
Location: Superior, CO, USA
Online

No, it got missed when I did the 2.x update

What do you think would make sense for an exit value? I generally try to follow the Unix pattern of exiting with a zero when everything worked ok, and non-zero other wise. Some programs try to use the exit value as almost an interprocess communication mechanism but that gets a bit complicated. Right now there is an exit with a one if some simple errors occur - should the SQLException be different?

Thanks for your feedback - I can role this in pretty quick but would like to make sure that it is useful to you too.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
idiotjones

Newbie

Joined: 08/16/2010 14:30:47
Messages: 2
Offline

All I am catching is that an error occurred, so an exit code of 1 works great for me. I suppose you could add an optional parameter for people who want to specify a different exit code, but that might be getting needlessly complicated.

In short, I like 1.
 
Forum Index » Jisql
Go to:   
Powered by JForum 2.1.8 © JForum Team
This site built by Scott Dunbar of Xigole Systems. © 2005-2010 - Scott Dunbar
Java and the Java Get Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
hotjoe.com and xigole.com have no affiliation with Sun Microsystems, Inc.