赞
踩
- import com.sun.org.apache.xerces.internal.impl.Constants;
-
- Constants类在%JAVA_HOME%/jre/lib/rt.jar包中
-
- try{
- File file = new File(absoluteDbConfigFile);
- Reader reader = new InputStreamReader(new FileInputStream(file),"utf-8");
- SAXReader sax = new SAXReader();
- sax.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE, false); //设置不需要校验头文件
- document = sax.read(reader);
- root = document.getRootElement().element("session-factory");
- buildCache();
- }catch(FileNotFoundException e){
- //e.printStackTrace();
- }catch(Exception e){
- //e.printStackTrace();
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。