Confusion in exception handling

Hi to all!

I have got a confusion in exception handling mechanism.

The scenario is:

I am calling a method from a servlet. That method have called some methods that throws some exceptions (actually SQLException).

Then what should I do:-

1. Handle those exceptions in that method only.

2. Pass those exceptions to the servlet (using throws keyword).

Which one is a better approach.

Message was edited by: Sumit Tyagi

Sumit_Tyagi

[487 byte] By [Sumit_Tyagia] at [2007-11-27 3:10:46]
# 1
i'm not sure it will make a great differenceby the way, some more code could help us make the choice
calvino_inda at 2007-7-12 8:13:11 > top of Java-index,Java Essentials,Java Programming...
# 2
Recommended you handle exceptions closer to where they are thrown. There's an efficiency factor in routing exceptions all the way down the stack to the service outine of servlets.
prideafricaa at 2007-7-12 8:13:11 > top of Java-index,Java Essentials,Java Programming...