myeclipse 连接mysql出现下面错误,明明有数据库怎么就找不...

如题所述

你的数据库驱动写错了撒.
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
String DBDriver = "com.mysql.jdbc.Driver";
String ConnStr = "jdbc:mysql://localhost:3306/student";
String MyUser = "root"; //用户名
String MyPassword = "root";
public DBManager(){
try{
Class.forName(DBDriver);
}catch(java.lang.ClassNotFoundException e){
System.err.println(e.getMessage());
}
}
ni你试试这个
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-08-06
加载驱动了吗
相似回答