我刚刚配置好了。把下载的mysql-connector-java-2.0.14解开,找到mysql-connector-java-2.0.14-bin.jar拷贝到TOMCAT/common/lib和JB7的LIB下面;我还在project properties/require libs里面引入了mysql-connector-java-2.0.14-bin.jar,自己取一个名字,再ADD就可以了。然后运行一下通过。
String driverName = "org.gjt.mm.mysql.Driver";
String sourceURL = "jdbc:mysql://thehost:3306/dbname?user=abc&password=abc"; try{
Driver mysqlDriver = (Driver)Class.forName(driverName).newInstance(); Connection conn = DriverManager.getConnection(sourceURL);
}
String driverName = "org.gjt.mm.mysql.Driver";
String sourceURL = "jdbc:mysql://thehost:3306/dbname?user=abc&password=abc"; try{
Driver mysqlDriver = (Driver)Class.forName(driverName).newInstance(); Connection conn = DriverManager.getConnection(sourceURL);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货