Slide 12.4: Importing packages
Slide 12.6: Opening a connection to a database
Home

Registering the JDBC Drivers


You must provide the code to register your installed driver with your program. You do this with the static registerDriver( ) method of the JDBC DriverManager class.
   DriverManager.registerDriver(
      new oracle.jdbc.driver.OracleDriver( ) );
The DriverManager class is used to open a connection to a database via a JDBC driver, which must be registered with the DriverManager. DriverManager chooses from a given list of available drivers to suit the explicit type of database connection. Three major methods of this class are You declare a specific driver name string to registerDriver( ) and register the driver only once in your Java application.