Skip to content
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

RelationalDataAccessApplication has org.springframework.jdbc.BadSqlGrammarException #27

Open
r00t4dm opened this issue Dec 28, 2020 · 6 comments

Comments

@r00t4dm
Copy link

r00t4dm commented Dec 28, 2020

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
Copy link
Contributor

Buzzardo commented Oct 9, 2023

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

@43v3rn88b
Copy link

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

@Buzzardo
Copy link
Contributor

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

@43v3rn88b
Copy link

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
Copy link
Contributor

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 added a commit to 43v3rn88b/gs-relational-data-access that referenced this issue Jan 30, 2024
"jdbcTemplate.execute("DROP TABLE customers IF EXISTS");" to
"jdbcTemplate.execute("DROP TABLE IF EXISTS customers");" as stated in spring-guides#27
@43v3rn88b
Copy link

I submitted a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants