Type-4 driver also known as Pure Java Driver OR Thin Driver.
This Driver is developed to talk with the Database directly without taking Support of ODBC Driver OR Vendor Specific Native Libraries OR Middleware Server. This Driver uses Database specific Native Protocols to communicate with the Database. This Driver converts JDBC Calls directly into Database specific Calls.
This Driver developed only in Java and hence it is also known as Pure Java Driver. Because of this, Type-4 Driver is Platform Independent Driver. This Driver won’t require any Native Libraries at Client side and hence it is light weighted. Because of this it is treated as Thin Driver.
- It won’t require any Native Libraries, ODBC Driver OR Middleware Server
- It is Platform Independent Driver
- It uses Database Vendor specific Native Protocol and hence Security is more.
The only Limitation of this Driver is, it is Database Dependent Driver because it is communicating with the Database directly.
It is highly recommended to use Type-4 Driver.
Java Application ➔ Type-1 Driver ➔ ODBC Driver ➔ DB
Java Application ➔ Type-2 Driver ➔ Vendor Specific Native Libraries ➔ DB
Java Application ➔ Type-3 Driver ➔ Middleware Server ➔ DB
Java Application ➔ Type-4 Driver ➔ DB
Which Driver should be used?
- If we are using only one Type of Database in our Application then it is recommended to use Type-4 Driver.
- If we are using multiple Databases in our Application then Type-3 Driver is recommended to use.
- If Type-3 and Type-4 Drivers are not available then only we should go for Type-2 Driver.
- If no other Driver is available then only we should go for Type-1 Driver.