How many types of jdbc drivers are there




















#|
Save Article. Improve Article. Like Article. Previous How is Java platform independent? Next Is main method compulsory in Java? Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Since it required a native API to connect to the DB client it is also less portable and platform-dependent. If the native library e. UnsatisfiedLinkError: no dll in java. The performance of the type 2 driver is slightly better than the type 1 JDBC driver.

It was very different than type 1 and type 2 JDBC drivers in the sense that it was completely written in Java as opposed to the previous two drivers which were not written in Java.

That's why this is also known as all Java drivers. This driver uses 3 tier approach i. So you have a Java client talking to a Java server and Java Server talking to the database. This driver is implemented in Java and directly speaks to the database using its native protocol. This driver includes all database call in one JAR file, which makes it very easy to use. Because of being lightweight, this is also known as a thin JDBC driver.

Since this driver is also written in pure Java, it's portable across all platforms, which means you can use the same JAR file to connect to MySQL database even if your Java program is running on Windows, Linux, or Solaris. Performance of this type of JDBC driver is also best among all of them because database vendors liked this type and all enhancements they make they also port for type 4 drivers. Though both type 1 and type 2 drivers are not written in Java, there was some significant difference between them.

Type 2 driver has better performance than type 1 driver because of less layer of communication and translation. The main difference between type 2 and type 3 JDBC drivers is that as opposed to type 2 drivers, type 3 is completely written in Java. Another difference which comes from this fact is that type 3 driver is more portable than type 1 and type 2 drivers because it doesn't require any native library on the client-side to connect to database.

In terms of architecture, this was 3 tier architecture and uses a net protocol for client-server communication. This is the highest performance driver available for the database and is usually provided by the vendor itself. This kind of driver is extremely flexible, you don't need to install special software on the client or server. Further, these drivers can be downloaded dynamically. Because of the proprietary nature of their network protocols, database vendors usually supply type 4 drivers.

If you are accessing one type of database, such as Oracle, Sybase, or IBM, the preferred driver type is 4. If your Java application is accessing multiple types of databases at the same time, type 3 is the preferred driver.

Type 2 drivers are useful in situations, where a type 3 or type 4 driver is not available yet for your database. The type 1 driver is not considered a deployment-level driver, and is typically used for development and testing purposes only.

Previous Page.



0コメント

  • 1000 / 1000