JDBC读取配置文件

Properties prop = new Properties();

prop.load(this.class.getClassLoader().getResourceAsStream("path"));

             url = prop.getProperty("jdbc_url");
             name = prop.getProperty("className");
             user = prop.getProperty("jdbc_username");
             password = prop.getProperty("jdbc_password"); 
posted @ 2017-12-24 16:45  小虎Tiger  阅读(311)  评论(0编辑  收藏  举报