连接池找不到属性文件!!! 你把这个文件复制到你的Classpath路径的Config下去。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是把db.properties 放在WEB-INF\classes\config下吗?如果是的话我就这样弄的啊 放在classes目录下,与你的类同级 谢谢各位我已经搞定了我先做了如下改动(".\\config\\db.properties");-----------》("db.properties");("./config/db.properties");-------------》("db.properties");能用。但属性文件的地方不是想要的,后来又做了如下改动:把FileInputStream is=null; try{ if(System.getProperty("file.separator").equals("/")) is= new FileInputStream("./config/db.properties"); else is= new FileInputStream(".\\config\\db.properties"); }catch(FileNotFoundException e){ System.out.println("File db.properties not found"); }改为InputStream is = getClass().getResourceAsStream("/config/db.properties");("/config/db.properties");这个路径可以自己设置。希望对大家能有帮助。谢谢各位的回答。 子窗口list中选中的值返回父窗口 log输出 Extjs GRID 显示无法显示数据,请高手帮忙看看,初学JAVA 免费做java实习生 询问在JSP下用什么作界面?AWT?SWING? 关于getParameterValues()的奇怪问题 谈谈Struts的感受 各位哥哥姐姐!请教,怎样在jsp中实现文件的批量上传阿。 请问编写JSP用什么开发工具最好??? 用什么工具写jsp比较好,请大家多给给意见! 祝福明年薪情愉快 求打印方法
如果是的话我就这样弄的啊
我先做了如下改动
(".\\config\\db.properties");-----------》("db.properties");
("./config/db.properties");-------------》("db.properties");
能用。
但属性文件的地方不是想要的,后来又做了如下改动:
把
FileInputStream is=null;
try{
if(System.getProperty("file.separator").equals("/"))
is= new FileInputStream("./config/db.properties");
else
is= new FileInputStream(".\\config\\db.properties");
}catch(FileNotFoundException e){
System.out.println("File db.properties not found");
}改为InputStream is = getClass().getResourceAsStream("/config/db.properties");("/config/db.properties");这个路径可以自己设置。
希望对大家能有帮助。
谢谢各位的回答。