aspose file tools*
The moose likes JDBC and the fly likes drivers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "drivers" Watch "drivers" New topic
Author

drivers

Rahul Shilpakar
Ranch Hand

Joined: Aug 29, 2006
Posts: 132
exactly , when to use java thin driver for connectivity? i mean to say how it differs from jdbc odbc? thanks


Perform for today. Adapt for tomorrow.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I'm guessing you are talking about Oracle's thin driver?

Sun's JDBC-ODBC bridge is a type 1 driver. All the driver does is provides a connection to ODBC functionality supplied by the client machine the driver is installed on. As such it requires ODBC software is installed on the client machine. It also only supports a sub-set of the JDBC API functionality.

Oracle's thin driver is a type 4 driver. This type of driver talks directly to the database via some protocol (e.g. TCP/IP). As such it doesn't require anything else be installed on the client machine.

Have a look at the JDBC guide supplied by Sun.
[ September 08, 2006: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rahul Shilpakar
Ranch Hand

Joined: Aug 29, 2006
Posts: 132
thanks.

can we say jdbc odbc a third party driver
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not really. The vast majority of drivers were not written by Sun, so they are almost all third party drivers. Better to call it a "type 1" driver, since that is the term used in the JDBC specification, so is the term most likely to be understood by others.
Nelson Nadal
Ranch Hand

Joined: Jun 06, 2002
Posts: 170
Hi Paul,
Does this mean that connection from client/server application is really quite different from web based application?

Is that why in client/server(J2SE) they only used the 'DriverManager' class (though I know its also used in J2EE)
while in web based (J2EE) they used the 'DataSource' for connection pooling?

Forgive me, if my question is a little confusing. I just dont know WHEN and WHERE to use the second one 'DataSource.. InitialContext..'

Thanks.
emm raha
Ranch Hand

Joined: Mar 18, 2003
Posts: 57
Hi Nelson:

You should use the JDBC/ODBC bridge when multiple connections are not required. Multiple instances of your application can create and close connections using the bridge, but this is far less efficient than using a connection pool.

The third party database drivers (e.g. Oracle, MySQL) adhere to the JDBC spec provided by Sun, which enables them to abide by a single contract across multi-vendor application servers (e.g. JBoss, Websphere). If your J2SE application enabled pooling as per the JDBC spec, it too could use Oracle's thin driver.

If your (web) application is hosted on a application server, you can retreive the datasource using the JNDI initial context (thereby leaving the pooling work up to the app server).

HTH
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drivers