com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "3306:myceshi"
myceshi是数据库名
java.lang.NumberFormatException: For input string: "3306:myceshi"
这个异常是由于他准备把你的"3306:myceshi"这个值转换为数字,所有是这里出错了
你这个其实是你的数据库连接写法错了改成这样
3306/myceshi
如果不行的话,把你的数据库连接代码或配置文件发到我邮箱:rabbit110423@163.com
你把你的连接代码贴出来
我把它发过去了,请多指教。
/**
@author weichk
*/
public class JDBC {
private static final String URL = "jdbc:mysql://localhost:3306/myceshi";
private static final String USER = "root";
private static final String PASSWORD = "root";
static {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("加载Mysql数据库驱动失败!");
}
}
/**
/**
你的驱动包有了吗?密码正确?
多谢各位问题已经解决