JDBC Architecture is divided into 4 layers -
- JDBC Client
- JDBC Driver Manager
- JDBC Driver
- Database
JDBC API uses a driver manager and database specific drivers to provide transparent connectivity to heterogeneous databases. The JDBC driver manager ensures that correctly driver is used to access each data source/database.
Type 1 Driver : JDBC-ODBC Bridge Driver
- JDBC-ODBC bridge driver is developed by sun microsystem. It is a part of standard JDK.
- It is removed from standard JDK from 8.0
- JDBC-ODBC bridge driver uses another driver called ODBC driver to communicate with database.
- JDBC-ODBC bridge driver converts each JDBC call to ODBC call and this ODBC call is converted to database specific call and send to database.
Advantage
- It is only one driver which is able to communicate with any database provided ODBC drivers.
Disadvantages
- It is platform dependent.
- Each client system required ODBC drivers.
- Database vendors may not provide ODBC drivers.
Type 2 Driver : Native API and partially java driver
- Type 2 driver are vendor specific drivers. These drivers are provided by database vendors.
- Type 2 driver converts every JDBC call to Native API. This Native API communicate with database.
Advantage
- It is efficient as compared to Type 1 driver.
Disadvantage
- Need software at client side (Native API)
- Native API's are platform dependent.
- It is used to develop two-tier applications
Type 3 Driver : Net API and all java drivers
It is developed based on 3 tier architecture. Client, Middle Server, Database Server. Type 3 driver uses network protocol or API to communicate with middle server which uses Type 1, Type 2 or Type 4 drivers to communicate with database.
Advantage
- Not required any software at client side
Disadvantages
- Not efficient
Type 4 : Native protocol and pure java driver
- Type 4 drivers are called vendor specific drivers, because it is developed by database vendors.
- These drivers implement database specific protocol.
- It is direct to database driver.
Advantage
- Efficient
- Not required any software at client side.
- For developing 2-tier and n-tier application
No comments:
Post a Comment