qq_51972040
2022-05-14 14:37
采纳率: 0%
浏览 9

Can't find bundle for base name a, locale zh_CN

import java.sql.;
import java.util.
;

public class jdbc3 {
public static void main(String[] args) throws ClassNotFoundException {
//下面这行报错
ResourceBundle bundle=ResourceBundle.getBundle("a");
String driver=bundle.getString("driver");
String url=bundle.getString("url");
String password=bundle.getString("password");
String user=bundle.getString("user");
Connection con =null;
Statement sta=null;
try {
Class.forName(driver);
con=DriverManager.getConnection(url,user,password);
sta=con.createStatement();
String sql="update stu1 set name='王傻狗' where 班级='电商'";
int c=sta.executeUpdate(sql);
System.out.println(c==1?"更新成功":"更新失败");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch(SQLException e){
e.printStackTrace();
}finally{
try {
if(sta!=null)
sta.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
if(con!=null)
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

}

}
Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name a, locale zh_CN
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:715)
at jdbc3.main(jdbc3.java:9)

img


为啥不行呀,找了百度改了一会没区别

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题