我的配置文件如下:
<?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">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.password">root$12</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/mysql</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<mapping resource="com.sst.Course.hbm.xml"/>
</session-factory>
</hibernate-configuration>
在创建控制台配置时,我在加载数据库驱动程序时遇到错误。
答案 0 :(得分:0)
尝试使用com.mysql.jdbc.Driver
替换在您的控制台配置中验证数据库连接(Drivers,jar,...)