• Post Reply Bookmark Topic Watch Topic
  • New Topic

SCJD Beta: db exceptions  RSS feed

 
Junilu Lacar
Sheriff
Posts: 10894
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac 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: 17309
11
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
Boost this thread!