GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement

We Are Going To Discuss About GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement. So lets Start this Java Article.

GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement

  1. GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement

    You should try a different dialects likeorg.hibernate.dialect.MySQL5Dialect OR org.hibernate.dialect.MySQLMyISAMDialect OR org.hibernate.dialect.MySQLInnoDBDialect to see which one works for you.

  2. GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement

    You should try a different dialects likeorg.hibernate.dialect.MySQL5Dialect OR org.hibernate.dialect.MySQLMyISAMDialect OR org.hibernate.dialect.MySQLInnoDBDialect to see which one works for you.

Solution 1

You should try a different dialects likeorg.hibernate.dialect.MySQL5Dialect OR org.hibernate.dialect.MySQLMyISAMDialect OR org.hibernate.dialect.MySQLInnoDBDialect to see which one works for you.

All in all , your current dialect is generating , type=MyISAM while it should be , ENGINE=MyISAM in create table query.

mysql error ‘TYPE=MyISAM’

You should read this too , Why do I need to configure the SQL dialect of a data source?

Your logs say that this 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 that query directly on mysql command prompt to see if that works for your MySQL version.

Also, in question do specify your MySQL version too.

Hope it helps !!

Original Author Sabir Khan Of This Content

Solution 2

You are using an updated version of MySQL but using and old dialect

Use either,

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

OR

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

in the hibernate.cfg.xml file.

This prevents you from getting dialect issues.

Original Author Dulith De Costa Of This Content

Solution 3

The reason you are facing this error might be any of the reasons below:-

  • The column name in the DB Script and the model/entity class are different.
  • There is a spelling mistake in your configuration file while mentioning property value.
  • The MySQL version is not getting matched with the dialect that you are mentioning.

I was facing this error because I change the column names in my DATABASE SCRIPT but forgot to change it in the Model/Entity class. So, after 4 hours of pulling my hairs I simply did this and my application started running.

Original Author Ashwani Sharma Of This Content

Solution 4

Change in hibernate configuration XML file.

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

Original Author Ganesh Giri Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment