aspose file tools*
The moose likes JDBC and the fly likes Type 2 Drivers -Native API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Type 2 Drivers -Native API" Watch "Type 2 Drivers -Native API" New topic
Author

Type 2 Drivers -Native API

thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207
Why deoes this driver call a partly java driver ?
How does this driver communicate with RDBMS?
What is the native library ?In the case of Oracle,Is OCI library a native library?.
And this piece of code to be present on the client machine.Which one is the client machine in web application? Is it the webserver which host the web application?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

These drivers use a native client library specific to the data
source to which they connect.
The driver is called partly java because the java part of the driver calls the native library. This means that the native library must be at client side i.e. the place where the driver is used.
In a web app the machince that hosts the web app is the client. You need the native library installed in this machine. In case of Oracle it is OCI.
The java part of the driver makes native calls to the library and library in turn communicates with the database server. The drivers are not portable.


Groovy
thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207
Could you please explain me that why Driver Type 2 is not portable?
And what does it mean by portable?
What are the drivers coming under this category?
Could you please give me examples of these drivers (oracle/sql server)?
What are advantages and disadvantages of this driver ?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

The type 2 drivers make use of the native library and these libraries are specific to a platform. I cannot use the same driver in different platform.
Example of type 2 driver : Oracle OCI
Type 4 drivers are portable because they are completely written in java and performs better. Oracle Thin driver is better.

Read this nice article!
www.javaworld.com/javaworld/jw-07-2000/ jw-0707-jdbc.html
thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207
Heartfelt thanks for your nice explanation and the informative web page .
I have following questions,could you please give answers for that ?
Type 2 Drier
Cons
The vendor database library needs to be loaded on each client machine. Consequently, type 2 drivers cannot be used for the Internet. Type 2 drivers show lower performance than type 3 and type 4 drivers.
Why does not it use for internet purpose ?Would it be download on each client machine ?
thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207
Heartfelt thanks for your nice explanation and the informative web page .
I have following questions,could you please give answers for that ?
1) Type 2 Drier
Cons
The vendor database library needs to be loaded on each client machine. Consequently, type 2 drivers cannot be used for the Internet. Type 2 drivers show lower performance than type 3 and type 4 drivers.
Why does not it use for internet purpose ?Would it be download on each client machine ? Would it necessary to download to the machine on which the browser using the internet? Is client machine a web server or browser ?
I got confused with the sentence "the vendor database library needs to be loaded on each client machine"....
2) Type 1 Driver JDBC-ODBC Driver
The ODBC driver and native connectivity interface must already be installed on the client machine. Thus any advantage of using Java applets in an intranet environment is lost, since the deployment problems of traditional applications remain
Why advantage of using Java applets in an intranet environment is lost while using the JDBC-ODBC Driver?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Why does not it use for internet purpose

Quite simple. The driver running in applet does not have native library to invoke in the machine.
Similarly for type 1 driver.
Joel Boeder
Greenhorn

Joined: Sep 08, 2003
Posts: 3
Please note that a pro for a type 2 driver is that it may support database and/or operating system dependent features. One important feature that some (not all) type 2 drivers may support is operating system authentication services.
Also type 2 may be faster or slower than type 4 drivers. The only way to find out is to test them out. Historically type 2 were faster but I think most type 4 drivers are now quicker than their type 2 counterparts. I would avoid any studies on this subject because they tend to be outdated. Ditto for books (which also often say that type 2 is faster).
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Please note that a pro for a type 2 driver is that it may support database and/or operating system dependent features. One important feature that some (not all) type 2 drivers may support is operating system authentication services.

Is it something that we cannot live without?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

The generally accepted rule is that type 4 drivers are the norm. They have ample performance, are flexible and are much easier to maintain. There are a few specific times when you might need a native driver( non type 4 driver ), but unless you are aware of this need, you should try for a type 4 driver.
Jamie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Type 2 Drivers -Native API