com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'itcastoa.user' doesn't exist

来源:互联网 发布:2017年国产动漫数据 编辑:程序博客网 时间:2024/06/06 01:04

org.hibernate.exception.SQLGrammarException: could notinsert: [cn.itcast.oa.domain.User]

       atorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)

       atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

Caused by:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table'itcastoa.user' doesn't exist

可能是因为在项目中添加的数据库驱动包与Hibernate.xml文件中所使用的方言版本不同引起的;

解决方案:如果使用的数据库的驱动包为mysql-connector-java-5.1.5-bin.jar,

则方言使用:org.hibernate.dialect.MySQL5InnoDBDialect

在Hibernate.xml主配置文件中配置方言可以使用查询类的快捷键Ctrl + Shift + T;

0 0
原创粉丝点击