• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Confusion with type 1 driver

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a doubt regarding JDBC-ODBC bridge driver.

Upto what I know in type1 driver you make a call to jdbc api. This call gets translated to odbc call and then database specific native call.

What i am not able to undesrtand :

step 1 :- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //will load the driver.
step2:- DriverManager.getConnection("jdbc:odbc:dsn");//This statement will internally calls the connect method of driver that is on the JdbcOdbcDriver class.

Step2 will rerurn me the connection object that means the object of the class that is providing implementation to the Connection interface.
My question is who will provide this class with the type1 driver.

Thanks


 
rakesh kadulkar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
further i want to ask where can i find this package

sun.jdbc.odbc in my jdk installation
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sun.jdbc.odbc.JdbcOdbcDrive



jdk will just have the interfaces of the driver classes .The actual implemented classes will be provided by the database vender .
These classes will be loaded into your system on installation of the databases ex: oracle into your system only.You can find these classes in the drivers folder some where in your oracle folder .
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


jdk will just have the interfaces of the driver classes .The actual implemented classes will be provided by the database vender .



thats true, "sun.jdbc.odbc.JdbcOdbcDriver" comes with JDK & JRE.
 
author
Posts: 4354
45
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There seems to be a done of questions about drivers lately, so let me see if I can sum it up "The maker of the database software provides the JDBC driver 99.99% of the time". The only exception is if there is no JDBC driver for that database, in which case an open source project may contain it, although this is rare in practice.

It makes sense if you think about it. JDBC is a universal method for you to write code that works on any database (in theory anyway), whereas the driver is the module that actually connects your JDBC code to the database, therefore the driver will be different for every database since interacting with each system is different. It also makes sense that it should not be included as part of the standard JVM. Could you imagine how many different database systems, versions of the system, and versions of the drivers Sun would need to include? The confusing part for most people seems to be "Yes, you need to go download a driver specific to your database" and "Yes, such a driver does exist. In fact it's often installed on your harddrive with the database itself".
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic