spring-guides / gs-relational-data-access

Accessing Relational Data using JDBC with Spring :: Learn how to access relational data with Spring.
https://spring.io/guides/gs/relational-data-access/
Apache License 2.0
80 stars 145 forks source link

RelationalDataAccessApplication has org.springframework.jdbc.BadSqlGrammarException #27

Open r00t4dm opened 3 years ago

r00t4dm commented 3 years ago

https://github.com/spring-guides/gs-relational-data-access/blob/adcc29334279b01b9e9d9bafcfb1f8fe61e625c1/complete/src/main/java/com/example/relationaldataaccess/RelationalDataAccessApplication.java#L32

Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [DROP TABLE customers if exists ]; nested exception is java.sql.SQLSyntaxErrorException: 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 'if exists' at line 1

please change Sql spell to "jdbcTemplate.execute("DROP TABLE IF EXISTS customers");"

Buzzardo commented 1 year ago

This easy fix is a good issue for a new contributor to fix, so I'm adding the good first issue label.

43v3rn88b commented 8 months ago

hello I tried to submit a PR for this fix but failed

Buzzardo commented 8 months ago

How did it fail? What messages did you get and from what tools?

43v3rn88b commented 8 months ago

I'm using intelliJ it says this: Can't create a new pull request: Push failed: remote: Permission to spring-guides/gs-relational-data-access.git denied to 43v3rn88b. unable to access 'https://github.com/spring-guides/gs-relational-data-access.git/': The requested URL returned error: 403

Buzzardo commented 8 months ago

Other than trying again, I have no idea what to tell you. I do my git work from the command line. You could try that.

43v3rn88b commented 8 months ago

I submitted a PR