The JDBC driver is the implementation of the JDBC specification. A type four JDBC driver in particular is normally provided to us by the database vendor.
Now in order to get connected to that DB we require to load the driver in the heap. Since the location of only the library classes is known in advance, you have to provide the location for your driver by setting the classpath to point to the driver's jar file and at the same time using fully qualified name in the Class.forName() method.
More over your program might be bringing data from various databases in which case you might require two or more drivers at the same time. To have an ordered access to the drivers JDBC provides us with the DriverManager . Usually every Driver has to register itself with the DriverManager. The registration code could be written inside a static block in the Driver class, hence Class.forName(), a single line does both loading and registration of the driver.(static blocks are executed during load time)