It's not a secret anymore!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes SCJD Beta: db exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "SCJD Beta: db exceptions" Watch "SCJD Beta: db exceptions" New topic

SCJD Beta: db exceptions

Junilu Lacar

Joined: Feb 26, 2001
Posts: 6499

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 )

Junilu - [How to Ask Questions] [How to Answer Questions]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
It is sorta covered in the JavaRanch Style Guide.
subject: SCJD Beta: db exceptions
jQuery in Action, 3rd edition