Bhadri
Bhadri

Reputation: 1699

What is the actual differance between type2 and type 4 driver in Jdbc

I have listened that type 2 driver needs some database library's apis. I cant understand above statement can you explain?

Upvotes: 5

Views: 12713

Answers (3)

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46395

Just a paragraph snippet from this link. Also, visit the helpful link : JDBC Driver and Its Types

Type 2: Requires the DB2 Client is also installed on the same server as the JDBC driver because the driver is simply a front-end to the DB2 Client. It points to the alias you configured on the Client for your database, similar to an ODBC driver.

Type 4: Connects to the database on server directly via the hostname/port.

Upvotes: 2

Harry Joy
Harry Joy

Reputation: 59650

I have listened that type 2 driver needs some database library's apis.

Yes. Type 2 drivers convert JDBC calls into database-specific calls means this is specific to a particular database. For example- Oracle will have its own oracle native driver API. While the Type 4 uses java networking libraries to communicate directly with the database server.

Upvotes: 0

lamwaiman1988
lamwaiman1988

Reputation: 3742

This link describe the difference between the 4 types of driver clearly. You may want to take a look at it.

Type 2 driver is database specific, as said in the article in the above link:

The distinctive characteristic of type 2 jdbc drivers are that Type 2 drivers convert JDBC calls into database-specific calls i.e. this driver is specific to a particular database. Some distinctive characteristic of type 2 jdbc drivers are shown below. Example: Oracle will have oracle native api.

Upvotes: 1

Related Questions