public Connection generateConnection() throws DataException {
String strDbName="imhrs";
String strUserName="root";
String strPassWord="root";
String strSQL="jdbc:mysql://localhost/"+strDbName;
Connection connection=null;
try{
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("mysqljdbcConection.............................error.....");
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
System.out.println("mysqljdbcConection.............................error.....");
e.printStackTrace();
}
connection=DriverManager.getConnection(strSQL,strUserName,strPassWord);
} catch (ClassNotFoundException e) {
// TODO �Զ���� catch ��
e.printStackTrace();
} catch (SQLException e) {
// TODO �Զ���� catch ��
e.printStackTrace();
}
return connection;
}
这是链接代码
下面的是报的错:
Access denied for user 'imhrs'@'localhost' (using password: YES)
这个错误的含义是什么了,还有就是 using password:YES这句话的意思是什么了。
String strDbName="imhrs";
String strUserName="root";
String strPassWord="root";
String strSQL="jdbc:mysql://localhost/"+strDbName;
Connection connection=null;
try{
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("mysqljdbcConection.............................error.....");
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
System.out.println("mysqljdbcConection.............................error.....");
e.printStackTrace();
}
connection=DriverManager.getConnection(strSQL,strUserName,strPassWord);
} catch (ClassNotFoundException e) {
// TODO �Զ���� catch ��
e.printStackTrace();
} catch (SQLException e) {
// TODO �Զ���� catch ��
e.printStackTrace();
}
return connection;
}
这是链接代码
下面的是报的错:
Access denied for user 'imhrs'@'localhost' (using password: YES)
这个错误的含义是什么了,还有就是 using password:YES这句话的意思是什么了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货