小编在学习hibernate时,在把所有环境都搭配好了,配置文件也弄好了,往事就绪时,测试所写的程序时出错了。错误提示说,未在数据库找到相应的表,所以不能插入数据。尝试了好多次都一样,最后网上找了好多资料才发现,所使用的数据库版本在5.0之后,在hibernate.cfg.xml配置文件中,在这里必须这样配置---->>
<propertyname="hibernate.dialect">
org.hibernate.dialect.MySQL5InnoDBDialect
</property>
而在数据库版本5.0之前的,hibernate.cfg.xml配置文件中,是这样配置的---->>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
小编能力有限,只能帮到这。