The type 2 driver is not written entirely in Java as it interfaces with non-Java code that makes the final database calls. The driver is compiled for use with the particular operating system. For platform interoperability, the Type 4 driver, being a full-Java implementation, is preferred over this driver.
However the type 2 driver provides more functionality and performance that the type 1 driver as it does not have the overhead of the additional ODBC function calls.
See also