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)
为啥不行呀,找了百度改了一会没区别