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"); 
原文地址:https://www.cnblogs.com/xiaohu1218/p/8098436.html