How can you load the drivers?

Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for example, you want to use the JDBC-ODBC Bridge driver, the following code will load it:Eg.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Your driver documentation will give you the class name to use. For instance, if the class name is jdbc.DriverXYZ , you would load the driver with the following line of code:E.g.Class.forName("jdbc.DriverXYZ");

Showing Answers 1 - 4 of 4 Answers

ARAVIND

  • Sep 15th, 2005
 

hai,loading the driver is in two ways. first method is Driver d=new oracle.driver.oracleDriver();DriverManager.registerDriver(d);and other method is same as the above which is already posted in aboveclass.for.name(...);

  Was this answer useful?  Yes

Ashwini

  • Oct 26th, 2005
 

2 ways :

1 class.forName("sun.jdbc.odbc.JdbcOdbc");

2 Driver d=new Driver("sun.jdbc.odbc.JdbcOdbc");

   DriverManager.registerDriver(d);

  Was this answer useful?  Yes

shekarGeek

  • Jul 25th, 2007
 

There are 2 ways to load the dirvers

1.By usiing Class.forName();

Ex- Class.forName("jdbc.odbc.OracleDriver");

2.By using DriverManager.

Driver thind=new Driver("jdbc:odbc:OracleDriver");
DriverManager.registerDriver(thind);

  Was this answer useful?  Yes

sudhakar

  • Sep 9th, 2007
 

by using:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","scott","tiger");

in the above way we can load the drivers.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions