If your business logic cannot do anything with your DBException, what is the need for 
defining one
such exception? Why not just throw the SQLException and handle it in the controller?

-Harish


--- Navjot Singh <[EMAIL PROTECTED]> wrote:
> hi gurus,
> 
> I have some facade layer for my database.
> That every method in that facade layer, naturally, *catches* SQLException
> and in return
>    throw new DBException( sqlexception);
> 
> My DBException is extending java.lang.Exception. So, I have to explicity
> throw it and later catch it in my business logic layer as well. Obviously,
> if there is DBException, even business logic CANNOT do anything but to pass
> the exception to presentation layer where it can be caught nicely by
> <global-exception>
> 
> What if i change my DBException to extend RunTimeException.
> 
> __That way__
>  + I need not to explicity throw and catch DBException.
>  + Few of my methods won't have to send 2-3 exceptions like
>       getBookList(int id) throws DBException, NoBookException
> 
> __Qs__
> + Would this exception still be catched by <global-exception>?
> + If YES, is it a nice thing to do?
> 
> Any comments are welcome
> - Navjot Singh
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to