<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///hibernate01</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">123</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="com/zql/hibernate01/demo1/Customer/hbm/xml"></mapping>
</session-factory>
</hibernate-configuration>
1、可能是字母拼写错误,还有注意大小写
2、dtd约束有没有贴错,不要粘贴mapping.dtd的约束
2、重新写一遍(我就是这么解决的,原因可能是写的顺序问题,也可能是拼写错误)