日期:2014-05-16 浏览次数:20547 次
String className = "org.gjt.mm.mysql.Driver"; Class.forName(className);
static { ....//获得一个驱动的实例driver DriverManager.registerDriver(driver); }
try { DriverManager.registerDriver(new org.gjt.mm.mysql.Driver()); }catch(SQLException e) { e.printStackTrace(); }
String driverName = "org.gjt.mm.mysql.Driver"; try { Thread.currentThread().getContextClassLoader().loadClass(driverName); }catch(SQLException e) { e.printStackTrace(); }