xml--->dom4j完成sys-config.xml
private XmlConfigReader() {SAXReader reader = new SAXReader();InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sys-config.xml");try {Document doc = reader.read(in);//取得jdbc相关配置信息Element driverNameElt = (Element)doc.selectObject("/config/db-info/driver-name");Element urlElt = (Element)doc.selectObject("/config/db-info/url");Element userNameElt = (Element)doc.selectObject("/config/db-info/user-name");Element passwordElt = (Element)doc.selectObject("/config/db-info/password");//设置jdbc相关的配置jdbcConfig.setDriverName(driverNameElt.getStringValue());jdbcConfig.setUrl(urlElt.getStringValue());jdbcConfig.setUserName(userNameElt.getStringValue());jdbcConfig.setPassword(passwordElt.getStringValue());System.out.println("读取jdbcConfig-->>" + jdbcConfig);} catch (DocumentException e) {e.printStackTrace();}}