Which is better: all-java (Type 4) drivers or native drivers (Type 2)?
A. The advantages of Type 4 drivers are the same advantages of Java code, namely portability and safety. Since Java code runs within the Java Virtual Machine, it cannot crash the process. The traditional advantage of Type 2 native drivers has been performance. However, with the rapid advances in Java performance, this is no longer always true. In general, JDBC driver performance is dependent on many factors, especially the SQL code used issued and the JDBC driver implementation.
The advantages of Type 4 drivers are the same advantages of Java code, namely portability and safety. Since Java code runs within the Java Virtual Machine, it cannot crash the process. The traditional advantage of Type 2 native drivers has been performance. However, with the rapid advances in Java performance, this is no longer always true. In general, JDBC driver performance is dependent on many factors, especially the SQL code used issued and the JDBC driver implementation.