准备重新捡起hibernate,开始重新新建个demo的时候发现老是报错 :
报错提示:
org.hibernate.exception.SQLGrammarException: could not execute statement
......
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.students' doesn't exist
......
原因很清楚,但很莫名其妙,不存在student这个表 (黑人问号???)
解决办法:hibernate.cfg.xml 中修改
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
为
<property name="dialect">org.hibernate.dialect.MySQLDBDialect</property>