Few question or confusions about
JDBC.
1) The argument we pass to class.forname(".... ") is for loading jdbc driver,in some books its written database vendors give free jdbc drivers,but in bruce eckel's thinking in
java its written this jdbc driver e.g(sun.jdbc.odbc.jdbcodbcdriver)
comes with jdk toolkit,so please clear from where do we load this driver either from database sofware or from jdk.
2) Second question is about some lines from java tutorial by sun in which it is written
"after loading class.forname("......"),
the second step in establishing a connection is to have the appropriate driver connect to the DBMS. The following line of code illustrates the general idea:
Connection con = DriverManager.getConnection (url,"myLogin","myPassword");
This step is also simple, with the hardest thing being what to supply for url . If you are using the JDBC-ODBC Bridge driver,the JDBC URL will start with jdbc
dbc: . The rest of the URL is
generally your data source name or database system.
If one of the drivers you loaded recognizes the JDBC URL supplied to the method DriverManager.getConnection , that driver will
establish a connection to the DBMS specified in the JDBC URL.
My questions are :
* What is this jdbc url?
* If we have already loaded the driver through class.forname then why it is written as first line of tutorial "The second step in establishing
a connection is to have the appropriate driver connect to the DBMS.
Please clear... Thanks.