You down with OOP? Yeah you know me!
You down with OOP? Yeah you know me!
You down with OOP? Yeah you know me!
Justin Fox wrote:Cool, alright..
But what if someone is inserting/Updating inventory into the database from front end app, And the modelnumber is the primary key, and they enter the same model number, shouldn't I catch the sqlexception and let them know that they can't insert duplicates?
. . .
Justin
-- Marty Fried
Left Coast, USA
Bear Bibeault wrote:Yes, Marty has it right -- that's exactly the scenario of #1. You catch the exception to do something else with it -- in this case, report the error to the user in a reasonable manner. Showing them a stack trace is not a "reasonable manner".
In no way is catching an exception simply to throw it again a useful exercise.
-- Marty Fried
Left Coast, USA
You down with OOP? Yeah you know me!
Consider Paul's rocket mass heater. |