Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Type2/Type4 and preparedstatement relation?

 
yo nara
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic