How can servlet initialization parameters be used effectively for database connectivity?
- By embedding database connection details directly in the servlet code.
- By relying on default database configurations provided by the servlet container.
- By storing database connection details as initialization parameters and retrieving them in the servlet's init() method.
- By using context parameters instead of initialization parameters for database connectivity.
Servlet initialization parameters can be used effectively for database connectivity by storing database connection details in the web.xml file and retrieving them in the servlet's init() method for establishing connections.
Loading...
Related Quiz
- The _________ method should be used carefully in servlets due to potential thread safety issues.
- How should a system handle a situation where a transaction is interrupted due to a system failure?
- _________ is a technique in Java to optimize memory usage by reusing objects.
- Describe the lifecycle of a WebSocket in a Java web application.
- In caching, __________ refers to the technique of dynamically adjusting the cache size based on current system load.