You are reading the article A Quick Glance Of Types Of Jdbc Driver With Its Structure updated in September 2023 on the website Speedmintonvn.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested October 2023 A Quick Glance Of Types Of Jdbc Driver With Its Structure
Introduction to JDBC DriverJDBC or Java Database Connectivity Driver is a software component that is analogous to ODBC drivers. The main purpose of JDBC is the ability to interact with Java applications with the database. The classes of JDBC are available in the packages chúng tôi and chúng tôi In addition to that, this helps in writing the applications that handle 3 programming activities such as:
Start Your Free Software Development Course
Web development, programming languages, Software testing & others
Connecting data sources like databases.
Query sending and updating of statements present in the database.
Retrieving as well as processing the responses obtained from the databases for the query sent.
Types of JDBC Driver
JDBC-ODBC bridge driver
Native-API driver
Network Protocol driver
Thin driver
1. JDBC-ODBC bridge driverStructure:
Components:
Client Machine with JDBC API, Java Application, JDBC-ODBC Bridge Driver, ODBC Driver, Vendor DB Library
Database
Advantages:
Independent of database connected
Easy to use
In-built with JDK
Connection to the database can be done easily
ODBC driver has to be installed on the machine of the client.
Not a portable driver.
Performance degradation as JDBC calls is converted to ODBC calls.
Application: Used in development as well as testing as it is not a deployment-level driver.
2. Native-API driverNative-API driver or Type-2 driver is an implementation of a DB driver that uses databases’ client-side libraries. Here, the method calls of JDBC are converted into native calls of DB API. This driver is offered by the vendors and works similar to Type-1 drivers. Here, all Java applications are supported by this driver except the Java applets. Even though I also not a portable driver, it is secure as well as faster compared to the Type-1 driver.
Structure:
Components:
Client Machine with JDBC API, Java Application, Native API Driver, Vendor DB Library
Database
Advantages:
Faster than JDBC-ODBC bridge driver.
Secure data transfer compared to the type-1 driver.
Upgraded performance compared to Type-1 driver.
Platform dependent
Except for applets, all java applications are supported by the driver.
Client-side libraries do not exist in all databases.
The vendor-client library, as well as vendor-specific driver, has to be installed in the machine of the client.
Not a portable driver.
Application: Used in situations where the drivers of Type-3 and Type-4 are not available for the database you are using.
3. Network protocol driverNetwork protocol driver or Type-3 driver is a driver that uses a middleware in order to convert method calls of JDBC into vendor-specific DB protocol. It is also known as a pure driver and follows a 3-tier communication approach in order to communicate with several databases. A standard network socket is needed by the clients of JDBC to communicate with the application server of middleware. The information or data obtained from the socket is then converted into to call format by the application server of middleware and forwards to the database. However, the supply of networks is needed on the client-side.
Structure:
Components:
Client Machine with JDBC API, Java Application, Network protocol Driver
Database
Middleware in server-side
Advantages:
The client-side library is not required as the server on the application can perform different functions such as logging, load balancing, auditing, etc.
Any DB can be handled by a single driver if the middleware is present.
Flexible
Fully written in Java
Secure
Not specific to a vendor
Network support is essential on the machine on the client-side.
DB specific coding is required in the middle tier.
Additional latency can occur as middleware is present.
The maintenance cost is higher.
The associated software is needed to work
4. Thin driverType 4 driver or Thin driver is a driver that is purely Java-based that interacts directly with the database of the vendor using a socket connection. It is also known as Direct to Database Pure Java Driver and considered as the driver with the highest performance for the database. The thin driver is usually offered by the vendor. Since it is very flexible, special software is not needed to install on the client as well as server sides. Moreover, these drivers are possible to dynamically download. DB vendors commonly supply this type of driver due to their proprietary nature.
Structure:
Components:
Client Machine with JDBC API, Java Application, Thin Driver
Database
Advantages:
Enhanced performance compared to another type of JDBC drivers
Software need not be installed in the client as well as the server-side.
Completely written in Java
Flexible
Portable drivers
Native DB library is not required
Middleware server is not required
Also known as a native protocol driver
Platform independent
Proprietary nature
Overhead does not occur during the conversion of JDBC calls in to ODBC calls or DB API calls.
Facilitates debugging as Java Virtual Machine handles every aspect of the application to database connection.
The driver is DB dependent
Application: Used at the time where the java applications access only one type of database such as IBM, Sybase, Oracle, etc.
ConclusionJDBC drivers are used to connecting Java applications with databases. It gives a connection to the database and a protocol is implemented for query and result transferring between client and database. In this article, different types of JDBC drivers along with its pros, cons, structure, components, and application are discussed in detail.
Recommended ArticlesYou're reading A Quick Glance Of Types Of Jdbc Driver With Its Structure
Update the detailed information about A Quick Glance Of Types Of Jdbc Driver With Its Structure on the Speedmintonvn.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!