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("jdbcdbc: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.
Joined: Jul 24, 2008
further i want to ask where can i find this package
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 .
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".