• Register
0 votes
1.4k views

Problem :

I am a completely novice in the hibernate world and facing below error,

WARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement

The exception while I run the stand-alone program in the hibernate 5.2.9 version. But in the hibernate 4 version all my code runs very well. I looked for many solutions but they are not working for me.

7 5 2
3,870 points

1 Answer

0 votes

Solution:

You must try the different dialects as follows

org.hibernate.dialect.MySQL5Dialect

or org.hibernate.dialect.MySQLMyISAMDialect or org.hibernate.dialect.MySQLInnoDBDialect 

to see which one exactly works for you.

It seems your current dialect is generating the type=MyISAM while it should be the  ENGINE=MyISAM in your create table query.

The mysql error 'TYPE=MyISAM'

Your logs are showing that following query was tried to be executed , 

create table MyTable (id integer not null, name varchar(255), primary key (id)) type=MyISAM 

So you should try to execute the query directly on the mysql command prompt to see if that properly works for the MySQL version.

OR

You are using the updated version of MySQL but using the very old dialect

You should use either,

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

OR below one

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

in your hibernate.cfg.xml file.

This will prevent you from getting the dialect issues

9 7 4
38,600 points

Related questions

0 votes
1 answer 3.7K views
3.7K views
Problem : After executing spring boot with h2 database and JPA i am facing below error org.hibernate.tool.schema.spi.commandacceptanceexception: error executing ddl via jdbc statement
asked Nov 12, 2019 peterlaw 6.9k points
0 votes
1 answer 2.2K views
2.2K views
Problem : I am getting bellow error while using hibernate JPA with spring and mongodb and running my application on Glassfish-4.0. javax.persistence.transactionrequiredexception: executing an update/delete query
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 1.9K views
1.9K views
Problem : I want to configure the hibernate orm mapping tool to my java class and want to use PostgreSQL as my database also I have configured the password as "password". But when I tried to run the application, I am facing following error ... in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
asked Dec 4, 2019 alecxe 7.5k points
1 vote
1 answer 1.4K views
1.4K views
Problem : When I try to compile my spring project, I always face the below error : Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed I have the ... >1.4.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> . . .
asked Dec 12, 2019 alecxe 7.5k points
0 votes
1 answer 23 views
23 views
Problem: I am working on Hibernate and now I am facing what I believe is a simple problem with the Hibernate but still I can't solve it. I have written a simple class I would like to persist but still keep facing below error: SEVERE: Field 'id' doesn't have a ... that is not working for me. Initializing the id also did not help me either! I am looking for Hibernate expert to fix my above error.
asked Jul 30 Raphael Pacheco 4.9k points