原配置文件是这样的

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <!-- 第一部分:配置数据库信息 -->
        <property name="hibernate.connection.driver_class">
            com.mysql.jdbc.Driver
        </property>
    </session-factory>
</hibernate-configuration>

改成下面这样就可以了。

<?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>
    </session-factory>
</hibernate-configuration>
    

 

相关文章:

  • 2021-12-26
  • 2021-06-16
  • 2021-11-27
  • 2021-11-29
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-23
  • 2021-12-19
  • 2021-06-09
  • 2021-07-22
  • 2021-07-02
  • 2022-01-30
相关资源
相似解决方案