JDBC (Java Database Connectivity) is a client-side API that allows users to access a variety of data sources, including spreadsheets, flat files, and relational databases. It’s a middle layer interface for connecting Java programmes to databases. JDBC is used for sending queries and changes to the database, as well as retrieving and processing data received from the database, in addition to connecting data sources.
There are four types of JDBC drivers:
- JDBC-ODBC bridge Drivers: Uses Open Database Connectivity(ODBC) to connect with the database. It’s also known as the Universal Driver as it can be used to connect with any database.
- Native-API Drivers: It’s a partial java Driver that uses client-side libraries of the database to convert JDBC calls into native ones of the database programming interface. The Network-API needs to be installed on individual client machines separately.
- Network protocol Drivers: The driver uses the middleware or application server to convert the JDBC calls into the vendor-specific protocol. It doesn’t require individual client-side installation as all the connectivity drivers are present in one driver.
- Thin Drivers: These are portable drivers that won’t require any installation from any client or server-side installation. They directly interact with the database and don’t require any database library to do so.