![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the architecture of JDBC?
If you want to develop a Java application that communicates with a database, you should use JDBC API. A driver is the implementation of the said API; various vendors provide various drivers, you need to use a suitable driver with respect to the database you need to communicate with. The driver manager loads the driver and manages the driver.
Following are the components of JDBC:
JDBC DriverManager: The DriverManager class of the java.sql package manages different types of JDBC drivers. This class loads the driver classes. In addition to this whenever a new connection establishes it chooses and loads the suitable driver from the previously loaded ones.
Note: From JDBC 4.0 the drivers in the CLASSPATH will be loaded automatically.
JDBC API: It is a Java abstraction which enables applications to communicate with relational databases. It provides two main packages namely, java.sql and javax.sql. It provides classes and methods to connect with a database, create statements (quires), execute statements and handle the results.