Home > Java > javaTutorial > What are the 4 types of JDBC drivers?

What are the 4 types of JDBC drivers?

青灯夜游
Release: 2018-11-23 16:25:58
Original
7409 people have browsed it

The content of this article is to introduce the four types of JDBC drivers, so that everyone can understand the advantages and disadvantages of the four types of JDBC drivers. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

The JDBC driver is a software component that enables Java applications to interact with a database. There are 4 types of JDBC drivers, namely:

1, JDBC-ODBC Bridge driver

2, Native-API driver (some are java drivers )

3. Network protocol driver (complete java driver)

4. Local protocol driver (complete java driver)

Let’s introduce this in detail 4 types of JDBC drivers to let everyone know the advantages and disadvantages of each driver.

Type 1: JDBC-ODBC Bridge Driver

The JDBC-ODBC Bridge driver uses the ODBC driver to connect to the database. The JDBC-ODBC bridge driver uses the ready-made ODBC architecture to convert JDBC calls into ODBC calls, avoiding the embarrassment of no JDBC driver being available.

However, due to the limitations of bridging, not all functions can be directly converted and called normally, and multi-layer call conversion also has a certain impact on speed. Unless there is no other solution, the bridging architecture should not be used.

What are the 4 types of JDBC drivers?

Note: In Java 8, the JDBC-ODBC Bridge has been removed.

Advantages:

1. Easy to use.

2. Can easily connect to any database.

Disadvantages:

1. Performance is reduced because JDBC method calls are converted into ODBC function calls.

2. The ODBC driver needs to be installed on the client computer.

Type 2: Native-API driver

The Native API driver uses the client library of the database and will directly call the native API provided by the database. Link library or client, because there is no intermediate process, the access speed usually performs well.

This driver converts JDBC method calls into native calls to the database API. It's not entirely written in java.

What are the 4 types of JDBC drivers?

Advantages:

The performance upgrade is better than the JDBC-ODBC bridge driver, and the access speed usually performs well.

Disadvantages:

1. Native driver needs to be installed on each client computer.

2. The client library needs to be installed on the client computer.

Type 3: Network Protocol Driver

The network protocol driver uses middleware (application server) to call JDBC directly Or indirectly converted to a database-independent protocol, the main purpose is to obtain better architectural flexibility; it is written entirely in Java.

What are the 4 types of JDBC drivers?

Advantages:

Since the application server can perform many tasks like auditing, load balancing, logging, etc., it is not Requires client library.

Disadvantages:

1. Network support is required on the client computer.

2. Database-specific coding needs to be completed in the middle layer.

3. Network protocol drivers become expensive to maintain because it requires database-specific coding to be done in the middle tier.

Type 4: Native Protocol Driver

Native Protocol Driver: Convert JDBC calls directly into database-specific network communication protocols . It is the most common driver type. The driver package jar used in our development basically belongs to this type of driver, which is usually provided directly by the database manufacturer, for example: mysql-connector-java.

Because it uses network communication, the driver can be completely written in java, supports cross-platform deployment, and has better performance.

What are the 4 types of JDBC drivers?

Advantages:

1. Performance is better than all other drivers.

2. No software is required on the client or server side.

Disadvantages:

The driver depends on the database.

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study. More related video tutorial recommendations: java tutorial!

The above is the detailed content of What are the 4 types of JDBC drivers?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template