Which concrete exception in the DataAccessException hierarchy should be thrown?

Trang Mắm

New member
Which concrete exception in the DataAccessException hierarchy should be thrown?
A. errorCode
B. SQLState properties of the caught SQLException
C. All of the mentioned
D. None of the mentioned
 
Answer: c
Explanation: As a DataAccessException wraps the underlying SQLException as the root cause, you can inspect the errorCode and SQLState properties with the following catch block.
 

Tìm kiếm

Back
Top