Q.1 What is JDBC? Explain the types of JDBC drivers?

JDBC (Java Database Connectivity) is a Java API that enables Java applications to interact with databases. It provides a standard interface for connecting to relational databases, executing SQL queries, and processing the results. JDBC is part of the Java Standard Edition (Java SE) and is widely used in enterprise applications for database operations.

Types of JDBC Drivers

JDBC drivers are used to establish a connection between a Java application and a database. There are four types of JDBC drivers, each with its own advantages and disadvantages:

  1. Type 1: JDBC-ODBC Bridge Driver
  2. Type 2: Native-API Driver (Partially Java Driver)
  3. Type 3: Network Protocol Driver (Pure Java Driver)
  4. Type 4: Thin Driver (Pure Java Driver)

Summary

The choice of JDBC driver depends on the specific requirements of the application, such as performance, portability, and ease of setup. For modern applications, Type 4 drivers are generally preferred due to their performance and portability.

**https://www.geeksforgeeks.org/jdbc-drivers/**


**Q.2 Explain the following classes with their use. (I) URLConnection class

(II) DatagramSocket (III) DatagramPacket class (IV) InetAddress class**