This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
  • Java Developer's Guide to E-Commerce with XML and JS
    Ashwin Tadepalli
    Posts: 27
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi William,
    Thank you for your valuable response.I came to know that System.exit(n) stops the JVM, i.e it stops the child process but it returns the status code to the parent process(denoting success for 0 and failure for n>0).All I am trying to do is to exit from the servlet code after checking for some conditions by hard coding instead of the system raising any SQL exceptions(like when I do a delete with no parameters passed) because they cannot be caught by an ordinary java client(run from the command prompt talking to a sevlet).I succeded in in solving the problem if I use try catch statements but I thought if there was a way in Java to exit from a program as in C++ using exit command.Could you tell me if there was any other way that we could solve this problem.
    Thanking you,
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!