小编yog*_*ani的帖子

Hibernate生成的DDL中语法错误"type = MyISAM"无效

我的Java代码出现此错误

   Caused by :`com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException`: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB` server version for the right syntax to use near 'type = `MyISAM`' at line 1
Run Code Online (Sandbox Code Playgroud)

这是hibernate传递的查询:

Hibernate: create table EMPLOYEE (emp_id integer not null, FNAME varchar(255), LNAME varchar(255), primary key (emp_id)) type=MyISAM
Run Code Online (Sandbox Code Playgroud)

我查看了与此错误相关的所有问题.但是在所有问题中,用户本身都在传递查询" type = MyISAM",因此他们可以将" type"改为" engine",但是这里hibernate负责创建表,所以我不明白错误在哪里,以及我如何解决它.

这是我的配置文件:

<hibernate-configuration>
 <session-factory >
 <property name="hibernate.hbm2ddl.auto">create</property>
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.url">jdbc:mysql://localhost/servletcheck</property>
  <property name="hibernate.connection.username">root</property>
  <property name="hibernate.connection.password"> </property>
  <property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect</property>
  <property …
Run Code Online (Sandbox Code Playgroud)

java mysql hibernate mariadb

30
推荐指数
3
解决办法
3万
查看次数

标签 统计

hibernate ×1

java ×1

mariadb ×1

mysql ×1