1

我正在尝试做这个网站的例子:http: //www.compilr.org/struts-2-and-hibernate-4-application/1343/

但是当我执行应用程序时,我可以在 Eclipse 控制台上看到这个错误: Initial SessionFactory creation failed.org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver com.mysql.jdbc.Driver class not found

但我认为正确的代码是下一个:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>
   <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
   <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
   <property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
   <property name="hibernate.connection.username">root</property>
   <property name="hibernate.connection.password">root</property>
<mapping resource="entity/Login.hbm.xml"/>
  </session-factory>

任何人都可以帮我一把吗?

感谢来自巴塞罗那 - 西班牙

4

0 回答 0