This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCJD Beta: db exceptions

 
Junilu Lacar
Bartender
Pie
Posts: 7758
61
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The DB exceptions are supposed to have two constructors: no-args and one String arg. The 1.4 Exception has two additional constructors that allow you to pass in a Throwable as well. Is anyone adding those to their DB exceptions?
I suppose you could argue that it's above what is asked for in the instructions but I'm thinking those additional constructors may come in useful later (when I actually get around to writing the DB client code )
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think using the newer constructor will allow you to wrap the actual exception into a DBException and send it to the client with the entire stack trace a root cause with it. It is called Exception chaining and it was added to 1.4 so I also think that is another reason to use it.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic