• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Difference between Type II and Type IV driver

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody explain me the difference between type 2 and type 4 jdbc driver. It is said that Type 4 driver directly specks to Database. it resides on server. Then wat resides on the client in case of type 4 that helps it to communicate with the DB.
i am looking for a details convincing answer
 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by raj jindal:
Can anybody explain me the difference between type 2 and type 4 jdbc driver.

Type 2 drivers act as wrapper across client code(native code libraries).basically the call is first delegeted to native code libraries which further interacts with database.
Type 4 drivers are not wrappers rather pure java drivers,call is directly made to destined database.
It is said that Type 4 driver directly specks to Database. it resides on server. Then wat resides on the client in case of type 4 that helps it to communicate with the DB.


The key point in using Type 4 driver is you just make type 4 driver classes available to calling code(through class path or other means)to let your code interact with database.
 
Raj Jindal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anybody explain me in more detail the difference between type 2 and type 4 jdbc drivers
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
vikasids sharma's explanation was quite good. Type II drivers use native (i.e., non-Java code), whereas type IV drivers are 100% Java. There are very few type II drivers anymore, but they were very common when JDBC first came out.
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raj
Will this help you?

---------------
Sainudheen
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But given the fact that the DB (RDBMS) is not implemented in Java, Type IV also uses native code so or so... only the level of abstraction is one level lower.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


But given the fact that the DB (RDBMS) is not implemented in Java, Type IV also uses native code so or so... only the level of abstraction is one level lower.


If by "native code" we mean only JNI code, then no, this isn't right; most type 4 drivers have no native code; they talk to the database using a database's own network interface.
 
Ranch Hand
Posts: 8953
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Type 4 drivers are pure java drivers with no native code but they proprietary protocol.
 
Pradeep bhatt
Ranch Hand
Posts: 8953
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
www.javaworld.com/javaworld/jw-07-2000/ jw-0707-jdbc.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic