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