我用的是hibernate3.1,mysql用的5.1,驱动用的是mysql-2.0.4.jar,为什么在反转的时候总是提示Could not get list of suggested identity strategies from database. Probably a JDBC driver problem. 

解决方案 »

  1.   

    mysql-connector-java-5.1.x-bin.jar
    换成这个驱动试试
      

  2.   

    <?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.MySQLDialect</property>
    <property name="connection.url">jdbc:mysql://localhost:3306/demo</property>
    <property name="connection.username">root</property>
    <property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
    <property name="myeclipse.connection.profile">MySQL</property>
    <property name="connection.password"></property></session-factory></hibernate-configuration>
      

  3.   

    测试链接的时候是成功的,而且在BD Browser中是可以连接成功的
      

  4.   

    这是反转失败后生成的文件
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" ><hibernate-reverse-engineering>
    </hibernate-reverse-engineering>
      

  5.   

    驱动换为 mysql-connector-java-5.1.x-bin.jar <property name="connection.driver_class">com.mysql.jdbc.Driver
    </property>