How to connect a database using Servlet and JSP?

Connecting a database using a servlet and JSP involves the following steps: