Say I am using preparedstatement for executing queries. if I use the same code using type2 and with type4 drivers. which one will execute more faster and efficient. is there any relation of preparedstatement with type of driver. what i have read from books is that type4 is pure java solution and more efficient than any other types.but since prepared statement are compiled on server side.is ther any relation of preparedstatement and type of driver.
Which database drivers do you want to compare? Since each implementation of type2 and type4 drivers are different, performance will vary within each type. The key is to find one that works for your situation( meets your functionality specs and performance expectations ) and best fits into your implementation plans. Personally, I've found the type 4 easier to work with and deploy, and performance has been more than acceptable( Oracle's thin drivers ). You might want to have a look through this chapter of Java Programming with Oracle JDBC. This compares Oracle's type 2 (OCI) and type 4 (thin) driver implementations. Jamie