`

读取properties文件

阅读更多
public class ConstantsClass {
private static Properties p;
        public static Properties getProperties(){
            p = new ConstantsClass().getProperties1();
            return p;
}
        public Properties getProperties1(){
            Properties p = new Properties();
    try {
                 InputStream is=this.getClass().getResourceAsStream("../mybatis/constants.properties");
                 p.load(is);
            } catch (IOException e) {
e.printStackTrace();
            }
    return p;
         }
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics