public class StaticConstant{ static { Properties properties = new Properties(); InputStream in = null; try { String url = StaticConstant.class.getResource("/jdbc.properties").getPath(); in = new FileInputStream(new File(url)); properties.load(in); String userName= properties.getProperty("username"); String pwd= properties.getProperty("pwd"); } }
java 读取配置文件信息
最新推荐文章于 2023-11-27 15:39:57 发布