读取static 中读取SRC目录下的配置文件

获取SRC目录

InputStream input=当前ClassName.class.getClassLoader().getResourceAsStream("hibernate.cfg.xml");

获取编译后的bin目录

String binPath=HibernateSessionFactory.class.getClass().getResource("/").getPath();  

 

posted @ 2012-10-22 14:47  为啥  Views(1135)  Comments(0Edit  收藏  举报