两个文件内容如下:
<?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">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/person</property>
<property name="connection.username">root</property>
<property name="connection.password">123321</property>

<mapping resource="com/Customer.hbm.xml" /></session-factory></hibernate-configuration>

解决方案 »

  1.   

    hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
    hibernate.connection.driver_class=com.mysql.jdbc.Driver
    hibernate.connection.url=jdbc:mysql://localhost:3306/person
    hibernate.connection.username=root
    hibernate.connection.password=123321
    hibernate.show_sql=true
      

  2.   

    <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
    这是2.0的
    3.0这句应该是
    org.hibernate.dialect.MySQLDialect
    这就是2.0和3.0的区别了
      

  3.   

    但是我用hibernate.properties却正常呢???
    好郁闷呀