How should you address this?

You are implementing a model component. You realize that an IOException might arise if you lose connection to the database. How should you address this?

You are implementing a model component. You realize that an IOException might arise if you lose connection to the database. How should you address this?

A.
Implement multipathing to provide redundant connectivity to the database, thereby avoiding that risk of connection failure.

B.
Provide an error handler page, and use the page directive in the invoking ISP to redirect to that page if the error arises.

C.
Use the JSTL <c:catch> tag to take control if the exception arises.

D.
Surround the problem area with a try/catch block and implement appropriate recovery or fallback behavior.



Leave a Reply 4

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


Ouadie

Ouadie

The Correct answer is : C

Arturo

Arturo

I think it’s B, because it says “model component”

manish

manish

D
model component means “plain old java object” pojo class ,so java code should be in try -catch block …..so ans is “D”

Rudi

Rudi

D is correct.

B & C are for JSP … so not correct