hibernate buildSessionFactory创建问题

Could not load requested class : org.h2.Driver
报这个错误,org.h2.Driver不是h2的数据库驱动吗?可我用的mysql,

com.mysql.jdbc.Driverorg.hibernate.dialect.MySQLDialectxml文件里面也没问题啊,求大神指教

检查下你的连接字符串,和你的账户设置,以及配置文件

你只贴这个靠想象是解决不了问题的,你将你的hibernate.cfg.xml里的内容贴出来

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">


org.hibernate.dialect.MySQLDialect
com.mysql.jdbc.Driver
xxxxxxxx
jdbc:mysql://localhost:3306/mydb
root

</session-factory>

  1. "<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">


    org.hibernate.dialect.MySQLDialect
    com.mysql.jdbc.Driver
    xxxxxxxx
    jdbc:mysql://localhost:3306/mydb
    root


    "

你们都是大神,小生只有膜拜!

等以后学hibernate的时候再说吧,我估计hibernate配置有问题,先回头学下div