jdbc returns mySQL syntax error exception for a valid query
-
05-07-2019 - |
Question
I user the java.sql.Statement.excecuteUpdate method to create a table and insert some values into the database through JDBC. However, it gives me MySQL syntax exceptions for no reason. I copied and pasted the same code into command prompt. it worked.
I'm wondering why it's doing that??
Solution
Guessing
You cannot do a query like: insert ...; insert ... ; only one query per method call
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow