d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Java: Interacting With A Database
Prev123
Add Reply New Topic New Poll
Member
Posts: 11,881
Joined: Aug 17 2007
Gold: 0.00
Dec 3 2014 11:32am
Quote (carteblanche @ Dec 3 2014 02:22am)
your business layer will throw an exception, and your presentation layer will catch it and tell the user that the id is invalid and needs to be entered again.


Thank you sir!
Appreciate it.

Member
Posts: 11,881
Joined: Aug 17 2007
Gold: 0.00
Dec 4 2014 12:19pm
Mhhh..Just kidding.

Solved problem by using merge as oppossed to saveOrUpdate.

Guess I should actually read the documentation ^_^

This post was edited by MidnightRider on Dec 4 2014 12:39pm
Member
Posts: 11,881
Joined: Aug 17 2007
Gold: 0.00
Dec 6 2014 03:32pm
If I am throwing an exception up to the Main method (no catch block), why does Eclipse insist I have a finally block?

I don't have any resources to close, but it feels wrong to put an empty finally block.
What am I missing?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 6 2014 08:55pm
if you have a try {}, you need either finally {} or catch {}
Member
Posts: 11,881
Joined: Aug 17 2007
Gold: 0.00
Dec 7 2014 10:53am
Quote (carteblanche @ Dec 6 2014 10:55pm)
if you have a try {}, you need either finally {} or catch {}


What if I don't have any "finally" code I want to execute?
Does that mean I've set things up incorrectly :P
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 7 2014 10:30pm
Quote (MidnightRider @ Dec 7 2014 11:53am)
What if I don't have any "finally" code I want to execute?
Does that mean I've set things up incorrectly  :P


then why are you using try{}? get rid of the try{} or add a catch{}/finally{}
Go Back To Programming & Development Topic List
Prev123
Add Reply New Topic New Poll