So i wanted to make a simple CRUD apps and i used the MYSQL Workbench for the database .
My connection in MySQL Workbench
Hostname : 127.0.0.1
Port : 3306
I don’t use password in MySQL Workbench.
and now my application properties looks like this
spring.datasource.url=jdbc:mysql://localhost:3306/employee_management_system?useSSL=false
spring.datasource.username=root
spring.datasource.password=
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLInnoDBDialect
spring.jpa.hibernate.ddl-auto=update
The error that i’m getting
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table employees (id bigint not null auto_increment, email_id varchar(255), first_name varchar(255), last_name varchar(255), primary key (id)) type=InnoDB" via JDBC Statement
and another one at the bottom part
Caused by: java.sql.SQLSyntaxErrorException: 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=InnoDB' at line 1
Please can someone help ?
Unknown
November 2004
edited November 2004 in Site Support
Dunno if its just me or not but i get this error:
Error executing SQL in MemberDAOImplJDBC.update.
from your data base when i try to change my personal info..
Thanks.
GoT
Comments
-
Unknown
November 2004
edited November 2004Changing the account info worked fine for me… maybe the SQL-DB was down for a moment…
This discussion has been closed.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Comments
After migration to spring-boot-gradle-plugin
2.0.2
from 1.4.6
I start getting :
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.2.17.Final.jar:5.2.17.Final]
Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: PUBLIC.USER
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) ~[hsqldb-2.4.0.jar:2.4.0]
With the 1.4.6
everything runs smooth.
Exception comes during db initialization with import.sql
spring:
jpa:
hibernate:
ddl-auto: create
snicoll
changed the title
spring-boot-gradle-plugin 2.0.2 migration results in «Error executing DDL via JDBC Statement»
Spring Boot 2 migration results in «Error executing DDL via JDBC Statement»
Jun 5, 2018
Upgrading from 1.4 to 2.0 also upgrades the Hibernate version you are using (as confirmed by the snippet you’ve shared).
It is impossible for us to say if this is a problem in Spring Boot, Hibernate or your application. If you want us to investigate, please take the time to share a sample that we can clone and run ourselves.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
@carlosag0712 thanks for the feedback but that sample doesn’t look minimal and I can’t build it
[ERROR] The project io.agileintelligence:demo:0.0.1-SNAPSHOT (/Users/snicoll/Downloads/DEVCONNECTOR-master/pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for gravatar:gravatar:jar is missing. @ line 66, column 21
Then your sample uses the MySQL dialect with H2 (which is not going to work very well). What are the instructions to reproduce the problem?
from
is a reserved keywords in many databases. I’ve renamed that field in both Experience
and Education
and the app starts fine.
This comment has been minimized.
This comment has been minimized.
how to resolve error executing ddl commands in spring boot
Hi I am new to spring Boot and i created new project(Demo) using spring initilizr Project structure is Project : Maven Project Language : Java Spring Boot : 2.4.2
application.propertites file is like
server.port=8084 spring.datasource.url=jdbc:postgresql://localhost:5432/demodb spring.datasource.username=postgres spring.datasource.password=root spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.show-sql=true spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
I have Created some classes and controllers :
Entity
@Entity public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private Integer id; @Column(name = "user_name") private String userName; @Column(name = "email") private String email; }
Repository :
@Repository public interface UserRepository extends CrudRepository<User, Integer> { }
Service :
@Service public class UserService { @Autowired private UserRepository userRepository; @Autowired private ObjectMapper objectMapper; public ResponseEntity addUser(JsonNode userData) { User user = objectMapper.convertValue(userData, User.class); userRepository.save(user); return ResponseEntity.ok(userData); }
Controller :
@RestController public class UserController { @Autowired private UserService userService; @PostMapping("/adduser") public ResponseEntity addUser(@RequestBody JsonNode userData){ return userService.addUser(userData); } }
But when i run the program i got error related to DB command : DLL command syntax error
as i am new to this framework i am not sure why this error is ? here are logs i am getting
error logs :
2021-02-10 12:09:55.296 WARN 14681 --- [ main] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL "create table user (id int4 not null, email varchar(255), user_name varchar(255), primary key (id))" via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table user (id int4 not null, email varchar(255), user_name varchar(255), primary key (id))" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:559) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:504) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.createTable(AbstractSchemaMigrator.java:277) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:71) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:207) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:184) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:316) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:469) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1259) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.3.jar:5.3.3] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.3.jar:5.3.3] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.3.jar:5.3.3] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.3.jar:5.3.3] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1847) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:609) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.3.jar:5.3.3] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1159) ~[spring-context-5.3.3.jar:5.3.3] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) ~[spring-context-5.3.3.jar:5.3.3] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588) ~[spring-context-5.3.3.jar:5.3.3] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar:2.4.2] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.2.jar:2.4.2] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.2.jar:2.4.2] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.2.jar:2.4.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.2.jar:2.4.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.2.jar:2.4.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.2.jar:2.4.2] at com.note.noteShare.NoteShareApplication.main(NoteShareApplication.java:10) ~[classes/:na] Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "user" Position: 14 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:322) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:308) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:284) ~[postgresql-42.2.18.jar:42.2.18] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:279) ~[postgresql-42.2.18.jar:42.2.18] at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95) ~[HikariCP-3.4.5.jar:na] at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-3.4.5.jar:na] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.4.27.Final.jar:5.4.27.Final] ... 35 common frames omitted
Advertisement
Answer
user
is a reserved keyword in postgresql. Change your table name to something else, for example:
@Entity @Table(name = "users") public class User {
10 People found this is helpful
- Remove From My Forums
-
Вопрос
-
hi
i get error with “Error 27506.Error executing SQL script create.db.2_C. Line 48. ALTER DATABASE statement failed. (5069)” when i install an application in to Windows 10 system which include SQL
2014 SP1 Express。below is the error log from Bootstrapper.log
>>>>Warnings: 17
>>>>Errors : 4
>>>>Duration: 00h 00m 05s
>>>>
>>>>Returned 0 [RC_AllCompleted]
>>>>============================================================
MSI log : Type=Information ID=1033 Event=Windows Installer installed the product. Product Name: IxLoad 9.00.115.204 Update2. Product Version: 9.00.115.204. Product Language: 1033. Manufacturer: Ixia. Installation success
or error status: 1603.
MSI log : Type=Information ID=11708 Event=Product: IxLoad 9.00.115.204 Update2 — Installation operation failed.
MSI log : Type=Information ID=1042 Event=Ending a Windows Installer transaction: D:Program Files (x86)IxiaInstallerCacheIxLoad9.00.115.204ixload.msi. Client Process Id: 5112.
MSI log : Type=Error ID=10005 Event=Product: IxLoad 9.00.115.204 Update2 — Error 27506.Error executing SQL script create.db.2_C. Line 48. ALTER DATABASE statement failed. (5069)
MSI log : Type=Information ID=1040 Event=Beginning a Windows Installer transaction: D:Program Files (x86)IxiaInstallerCacheIxLoad9.00.115.204ixload.msi. Client Process Id: 5112.
MSI props : Trying to read MSI prop 0 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ ->
MSI props : Trying to read MSI prop 1 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ -> INSTALLDIR
MSI props : Trying to read MSI prop 2 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ -> DELETECACHEFILES
MSI props : Trying to read MSI prop 3 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ -> STORAGE
MSI props : Trying to read MSI prop 4 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ -> INSTALL_RM
MSI props : Trying to read MSI prop 5 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ -> GATEWAYHTTPSOPTION
MSI props : Trying to read MSI prop 6 from ‘HKEY_LOCAL_MACHINESOFTWAREIxia CommunicationsInstallInfoBootstrapperMSIProperties{EEA3B24B-7343-4604-9D91-6B586F6EF9A6}’ -> NOT FOUND
MSI props : INSTALLDIR=’C:Program Files (x86)IxiaIxLoad9.00.115.204′ MSI.IXLOAD003.INSTALLDIR=’C:Program Files (x86)IxiaIxLoad9.00.115.204′ DELETECACHEFILES=’0′ MSI.IXLOAD003.DELETECACHEFILES=’0′
STORAGE=’C:ProgramDataIxiaResourceManagerStorage’ MSI.IXLOAD003.STORAGE=’C:ProgramDataIxiaResourceManagerStorage’ INSTALL_RM=’1′ MSI.IXLOAD003.INSTALL_RM=’1′ GATEWAYHTTPSOPTION=» MSI.IXLOAD003.GATEWAYHTTPSOPTION=»
Callback : 0 [RC_AllCompleted]
Ret.code : 1603 [Application returned code 1603: 安装时发生严重错误]
Output :
[INFO] Registry value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventLogApplicationMsiInstallerEventMessageFile is C:WindowsSystem32msimsg.dll
[INFO] Value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventLogApplicationIxiaInstallerEventMessageFile was set to C:WindowsSystem32msimsg.dll
[INFO] Registry value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventLogApplicationMsiInstallerEventMessageFile is C:WindowsSystem32msimsg.dll
[INFO] Value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventLogApplicationIxiaInstallerEventMessageFile was set to C:WindowsSystem32msimsg.dll
Ref.count : 0 -> 0 []
Ended at : 16:40:42 (duration: 10 min 50 sec)
Completed : No
________________________________________Any idea to resolve this ? Please help..thank u
Запущен MySQL на локальном сервере OpenServer. Создаю Базу Данных в программе Workbench ,создал связи таблиц в диаграмме, не получалось соединится с базой,всегда выбивало ошибку на запрос пароля. Покопавшись в программе нашел другую ошибку:
Executing SQL script in server
ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)
REFERENCES `blogDb`.`msgs` ()
ON DELETE NO ACTION
ON UPDATE NO ACT’ at line 14
SQL Code:
CREATE TABLE IF NOT EXISTS `blogDb`.`users` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`login` VARCHAR(45) NULL DEFAULT NULL,
`password` VARCHAR(45) NULL DEFAULT NULL,
`screen_name` VARCHAR(45) NULL DEFAULT NULL,
`email` VARCHAR(45) NULL DEFAULT NULL,
`type` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `login_UNIQUE` (`login` ASC),
UNIQUE INDEX `screen_name_UNIQUE` (`screen_name` ASC),
UNIQUE INDEX `email_UNIQUE` (`email` ASC),
CONSTRAINT `users`
FOREIGN KEY ()
REFERENCES `blogDb`.`msgs` ()
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
SQL script execution finished: statements: 5 succeeded, 1 failed
Fetching back view definitions in final form.
Nothing to fetch
Просьба помочь исправить данную ошибку.:
P.S. создаю впервые базу данных в программе Workbench.Если нужно могу приложить файл Базы Данных.
P.P.S. Может кто поможет в создании Базы Данных. В интернете инструкции по создании Баз Данных с помощью Workbench на пальцах пересчитать можно :. Спасибо.
-
Вопрос заданболее трёх лет назад
-
280 просмотров
posted 13 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
Hi,
I switched my jdbc driver from type 2 to type 4, right now i m using microsoft sql server jdbc driver of type 4. so as i generate any report in my application it throws error like: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : DataSummaryReport_2
I am using stored procedure to retrieve data like: exec wdcGetDataSummaryData $P{SerialNumberStr},$P{Date}
I have migrated from jdk1.4 to 1.6.
can you please help me to solve my problem.
thanks in advance..
posted 13 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
That statment is not valid transact SQL. I’m assuming this is how you bound variables using the old driver? Try binding using ?, e.g.:
and using setString and setDate accordingly.,
gunjaan titiyaa
Greenhorn
Posts: 3
posted 13 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
Hi,
thanks for the reply. i have used exec wdcGetDataSummaryData $P{SerialNumberStr},$P{Date} in my jrxml file, while using ireport. and passing parameter as input from database. in java code i used exec wdcGetDataSummaryData ?,?… and i got exception at a time of filling report on line:
JasperPrint jp =
JasperFillManager.fillReport
(jasperMain, parameters, connection);
Paul Sturrock
Bartender
Posts: 10336
posted 13 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
So what SQL is executed for DataSummaryReport_2 ?
gunjaan titiyaa
Greenhorn
Posts: 3
posted 13 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
It Is calling stored procedure retriving data from database for the report and stored in temp table. once report is generated temp table is deleted. but here i am not able to generate report itself and getting exception related to statement. i am also facing problem that from where it is giving error
Paul Sturrock
Bartender
Posts: 10336
posted 13 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
So what is the SQL for DataSummaryReport_2? The error message is telling you that there is something wrong with it.
posted 11 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
gunjaan titiyaa wrote:Hi,
I switched my jdbc driver from type 2 to type 4, right now i m using microsoft sql server jdbc driver of type 4. so as i generate any report in my application it throws error like: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : DataSummaryReport_2I am using stored procedure to retrieve data like: exec wdcGetDataSummaryData $P{SerialNumberStr},$P{Date}
I have migrated from jdk1.4 to 1.6.
can you please help me to solve my problem.
thanks in advance..
Hi!
This problem occure when using mssqljdbc4 driver. Replace it at your jasper server to jtds ms sql drivet — all will work fine. Driver is here: http://sourceforge.net/projects/jtds/files/