Which of the following are the valid methods for handling SQL exceptions generated in JDBC (Choose all that apply)?

Which of the following are the valid methods for handling SQL exceptions
generated in JDBC (Choose all that apply)?

Which of the following are the valid methods for handling SQL exceptions
generated in JDBC (Choose all that apply)?

A.
getSQLState()

B.
getErrorCode()

C.
getNextException()

D.
setNextException()

Explanation:
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 0

Your email address will not be published. Required fields are marked *