com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.id_gen' doesn't exist

来源:互联网 发布:淘宝怎么修改掌柜名字 编辑:程序博客网 时间:2024/06/01 09:41

java后台所提示的错误:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.id_gen' doesn't exist

 

11:26:56,984 ERROR JDBCExceptionReporter:101 - Unknown table 'hibernate_sequence' in field list

 

 

Junit4测试所提示错误:

org.hibernate.exception.SQLGrammarException: could not get next sequence value

 

出现这个问题是因为hibernate.cfg.xml的配置错误,我的错误是修改了mysql连接配置,而没有修改hibernate方言

如:

 

        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>

        <property name="connection.url">jdbc:mysql://127.0.0.1:3306/hibernate</property>

        <property name="connection.username">root</property>

        <property name="connection.password">centre</property>

<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>

 

 

原创粉丝点击