<?
xml version='1.0' encoding='UTF-8'
?>
<! DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
<! DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
就是上面这个头一直提示错误, 有必要改正一下。
2. Hibernate 的配置使用问题:
//
以下写法能找到对应文件
File fileConfigre = new File(CONFIG_FILE_LOCATION);
cfg.configure(fileConfigre); // configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
如果使用
cfg.configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
则会一直提示 CONFIG_FILE_LOCATION 无法找到
原因目前不知道
File fileConfigre = new File(CONFIG_FILE_LOCATION);
cfg.configure(fileConfigre); // configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
如果使用
cfg.configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
则会一直提示 CONFIG_FILE_LOCATION 无法找到
原因目前不知道
今天算是见鬼了,搞了半天一点进展都没有。