猿问

Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found

<?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="connection.username">root</property>

      <property name="connection.password">root</property>

     <property name="connection.driver_class">com.mysql.jdbc.Driver</property>  

      <property name="connection.url">jdbc:mysql://localhost:3306/hibernate?useUnicode=true&amp;characterEncoding=UTF-8</property>

    <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>

    <property name="show_sql">true</property>

    <property name="format_sql">true</property>

    <property name="hibernate.hbm2ddl.auto">create</property>

    

    <mapping resource="com/imooc/entity/Grade.hbm.xml"/>

    <mapping resource="com/imooc/entity/Student.hbm.xml"/>

    </session-factory>

</hibernate-configuration>



慕哥1162059
浏览 1024回答 1
1回答

翔仔

找不到hibernate.cfg.xml这个配置文件,请确保该文件存在或者读取路径正确
随时随地看视频慕课网APP

相关分类

Java
我要回答