spring可以整合hibernate,只需要在ApplicationContext.xml中定义sessionFactory的bean就行了,web.xml中要指定ApplicationContext.xml的位置,你缺少的不是Hibernate.cfg.xml文件,应该是你的bean对应的文件,就是你的对象与数据库映射的文件
<hibernate-mapping>
<class name="pojo.Customer" table="CUSTOMER">
<id name="id" column="CID">
<generator class="increment" />
</id>
<property name="username" column="USERNAME" />
<property name="password" column="PASSWORD" />
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="pojo.Customer" table="CUSTOMER">
<id name="id" column="CID">
<generator class="increment" />
</id>
<property name="username" column="USERNAME" />
<property name="password" column="PASSWORD" />
</class>
</hibernate-mapping>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货