Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Before you can open a database connection, you must first register the Oracle JDBC drivers with your Java program. As mentioned earlier, the JDBC drivers enable your JDBC statements to access the database.
There are two ways to register the Oracle JDBC drivers: the first is to use the forName() method of the class java.lang.Class, and the second is to use the registerDriver() method of the JDBC DriverManager class. The following example illustrates the use of the forName() method: