当你尝试利用 Java 程序通过 JDBC 与 MySQL 数据库实行 SQL 语句时,假如遇到 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException 异常,你会在程序的输出或日志中看到类似于以下内容的错误信息:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 ‘…’ at line X
这里的 ‘…’ 是 SQL 语句中出错的部门,X 是出错行号。