properties获取xml文件的信息语句。

public class SQLUtil {
/**
 * 加载.properties配置文件
 *
 * @param file
 * @return
 */
 public static Properties loadConfig(String file) {
Properties properties = new Properties();
 try {
 properties.load(ClassLoader.getSystemResourceAsStream(file));
 return properties;
 } catch (IOException e) {
 throw new RuntimeException(e);
 }
 }
}
原文地址:https://www.cnblogs.com/yongwuqing/p/5518148.html