org.hibernate.HibernateException是Hibernate的基本程序

时间:2010-08-16 12:51:06

标签: java mysql hibernate orm

我正在使用带有基本hibernate程序的MySQL workbench 5.2 CE数据库 在运行时它给我错误:

Caused by: org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.Driver

hibernate.cfg.xml中的代码:

<hibernate-configuration>
    <session-factory>
          <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="connection.url">jdbc:mysql://192.168.8.212/da?autoReconnect=true&amp;useOldUTF8Behavior=true&amp;useUnicode=true&amp;characterEncoding=UTF-8" /></property>
        <property name="connection.username">root</property>
        <property name="connection.password">password</property>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="myeclipse.connection.profile">MyEclipse Derby</property>
        </session-factory>
</hibernate-configuration>

1 个答案:

答案 0 :(得分:2)

mysql jdbc driver jar放在类路径上 - 如果它是WEB-INF/lib

的Web应用程序