天天看點

java.sql.SQLSyntaxErrorException報錯sql文法錯誤

java.sql.SQLSyntaxErrorException報錯

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 ‘-mail,birthday) value(‘熊二’,‘123123’,‘[email protected]’,‘1999-01-01’)’ at line

錯誤 提示如此,簡單查詢了一些網上的解決方法都不可行,

後來發現是資料表中的e-mail字段名出現問題,

sql語句出現“-”時會報錯,

是以把字段名中的e-mail改成email即可。

繼續閱讀