反编译得到org.gjt.mm.mysql.Driver的源码:
package org.gjt.mm.mysql;
import java.sql.SQLException;
/**
* Here for backwards compatibility with MM.MySQL
*
* @author Mark Matthews
*/
public class Driver extends com.mysql.jdbc.Driver {
// ~ Constructors
// -----------------------------------------------------------
/**
* Creates a new instance of Driver
*
* @throws SQLException
* if a database error occurs.
*/
public Driver() throws SQLException {
super();
}
}
由上可知无论使用的是 org.gjt.mm.mysql.Driver 还是 com.mysql.jdbc.Driver,实际上调用的都是 com.mysql.jdbc.Driver
org.gjt.mm.mysql.Driver 是老式写法,推荐使用 com.mysql.jdbc.Driver