Difference between JDBC and Servlet

JDBC:

JDBC is a Java API that is used to control and execute queries to the database. It uses JBDC drivers to connect to the database.

Servlet:

It is a small program that executes on the server-side on the web application.

JDBC vs Servlet:

JDBC
Servlet
1. JDBC is a Java API that is used to control and execute query to the database.1. Servlets are a small program that executes on the server-side on the web application.
2. JDBC has functions that helps Java to write basic SQL queries like Create, Update, Delete, etc.2. Servlet has functions to process the incoming request from the client and process it and output the result.
3. JDBC helps to connect the databases.3. Servlet can't connect the database without using JDBC.