[]应用JDBC时Class.forName()的作用

[]使用JDBC时Class.forName()的作用使用jdbc时,我们都会很自然得使用下列语句: package com.mysql.jdbcpub

[]使用JDBC时Class.forName()的作用
    使用jdbc时,我们都会很自然得使用下列语句:

package com.mysql.jdbc       public class driver extends nonregisteringdriver implements java.sql.driver {     // ~ static fields/initializers     // --------------------------------------------- //     // register ourselves with the drivermanager     //     static {        t ry {                  java.sql.drivermanager.registerdriver(new driver());              } catch (sqlexception e) {                  throw new runtimeexception("can't register driver!");              }      }    // ~ constructors     // -----------------------    /**     * construct a new driver and register it with drivermanager     *      * @throws sqlexception     *             if a database error occurs.     */    public driver() throws sqlexception {         // required for class.forname().newinstance()     }    }