专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Eclipse

Myeclipse6.5配置hibernate.cfg.xml c3p0的时候报dtd错,该如何解决

发布时间:2010-06-05 15:35:45 文章来源:www.iduyao.cn 采编人员:星星草
Myeclipse6.5配置hibernate.cfg.xml c3p0的时候报dtd错
<?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">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="connection.url">
jdbc:oracle:thin:@127.0.0.1:1521:orcl
</property>
<property name="connection.username">lj</property>
<property name="connection.password">lj123</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="myeclipse.connection.profile">driver</property>
<!-- 最大连接数 --> 
<property name="hibernate.c3p0.max_size">20</property>   
<!-- 最小连接数 -->   
<property name="hibernate.c3p0.min_size">5</property>   
<!-- 获得连接的超时时间,如果超过这个时间,会抛出异常,单位毫秒 -->   
<property name="hibernate.c3p0.timeout">120</property>   
<!-- 最大的PreparedStatement的数量 -->   
<property name="hibernate.c3p0.max_statements">100</property>   
<!-- 每隔120秒检查连接池里的空闲连接 ,单位是秒-->   
<property name="hibernate.c3p0.idle_test_period">120</property>   
<!-- 当连接池里面的连接用完的时候,C3P0一下获取的新的连接数 -->   
<property name="hibernate.c3p0.acquire_increment">2</property>   
<!-- 每次都验证连接是否可用 -->   
<property name="hibernate.c3p0.validate">true</property>


<mapping resource="com/zb/c3p0/entity/Userinfo.hbm.xml" />
<mapping resource="com/zb/c3p0/entity/Score.hbm.xml" />
</session-factory>

</hibernate-configuration>

一直都在报,上面的代码是自动生成的,下面c3p0的代码是自己另外加上去的

------解决方案--------------------
<property name="mappingResources">
<list>
<!-- 区域模块 -->
<value>com/zb/c3p0/entity/Userinfo.hbm.xml</value>
<value>com/zb/c3p0/entity/Score.hbm.xml</value> </list>
 </property>
这样写
------解决方案--------------------
<mapping resource="com/zb/c3p0/entity/Userinfo.hbm.xml" />
<mapping resource="com/zb/c3p0/entity/Score.hbm.xml" />

你怎么把 hibernate的实体类描述文件直接写在sessionfactory里面了


------解决方案--------------------
话说我看了下配置文件

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
</bean>
都是在bean标签里面配置的吧
------解决方案--------------------
不了解
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: