//读取配置文件 public class Tools { public static Properties loadProperties() { Properties properties = new Properties(); try { properties.load(ClassLoader.getSystemResourceAsStream("database.properties")); } catch (IOException e) { System.err.println("读取配置文件失败"); } return properties; } }