Slide 14.25: Importing packages
  Slide 14.27: 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 Because you are using one of Oracle's JDBC drivers, you declare a specific driver name string to registerDriver( ). You register the driver only once in your Java application.