PrepAway - Latest Free Exam Questions & Answers

which of the following are the valid methods for handling exceptions (Choose all that apply.?

In JDBC, which of the following are the valid methods for handling exceptions
(Choose all that apply.?

PrepAway - Latest Free Exam Questions & Answers

A.
getSQLState(.

B.
getErrorCode(.

C.
getNextException(.

D.
setNextException(.

Explanation:
Quoted directly from Sun’s Java document site at
http//developer.java.sun.com/
getSQLState(. returns an SQLState identifier based on the X/Open SQL specification.
Your DBMS manuals should list some of these or see Resources for information to find
SQLStates.
getErrorCode(. is provided to retrieve the vendor-specific error code.
getNextException(. retrieves the next SQLException or null if there are no more. Many
things can go wrong between your program and the database. This method allows
tracking all problems that occur.
setNextException(. allows the programmer to add an SQLException to the chain.


Leave a Reply