错误描述:
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 1

原因:

1、符号错误,比如 ? ,等打成中文字符。

2、执行语句时写成如下形式:

pst.executeUpdate(sql);

占位符语句不能用带有参数的executeUpdate()方法执行。若sql语句使用写死的语句则可以使用带参的方法。

解决方案:

1、重敲错误位置的字符。

2、执行语句去掉“sql”:执行pst.executeUpdate();


Logo

更多推荐