标签:getc nbsp 导入 tcl user drive bsp class 目的
(1)配置文件放在项目的根目录下
Properties properties = new Properties(); InputStream is = new FileInputStream("config.properties"); // 导入输入流 properties.load(is); // 读取 driverClass = properties.getProperty("driverClass"); url = properties.getProperty("url"); username = properties.getProperty("username"); password = properties.getProperty("password");
(2)配置文件放在src目录下
Properties properties = new Properties(); InputStream is = JDBCutils.class.getClassLoader().getResourceAsStream("config.properties"); // 导入输入流 properties.load(is); // 读取 driverClass = properties.getProperty("driverClass"); url = properties.getProperty("url"); username = properties.getProperty("username"); password = properties.getProperty("password");
标签:getc nbsp 导入 tcl user drive bsp class 目的
原文地址:https://www.cnblogs.com/chichung/p/10303205.html