How should this be handled?

During initialization, a servlet finds that the database connection it requires is unavailable. As the system designer, you know that the database start up completes several minutes after the webcontainer initializes the servlet. How should this be handled?

During initialization, a servlet finds that the database connection it requires is unavailable. As the system designer, you know that the database start up completes several minutes after the webcontainer initializes the servlet. How should this be handled?

A.
Retry the connection until it is successful, then allow the init () method to complete.

B.
Throw a ServletException

C.
Throw the IOException

D.
Throw an UnavailableException

Explanation:
Reference:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets6.html



Leave a Reply 1

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


Ouadie

Ouadie

The Correct answer is : D