Doctype正确吗?

时间:2013-04-23 08:51:11

标签: hibernate java-ee doctype

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

但是当我执行aplicacion时,我可以在Eclipse控制台上看到这个错误:初始SessionFactory创建失败..org.hibernate.service.classloading.spi.ClassLoadingException:未找到指定的JDBC驱动程序com.mysql.jdbc.Driver类< / p>

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

<?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>

有人可以帮忙吗?

感谢巴塞罗那 - 西班牙

0 个答案:

没有答案