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 '?'
出现这种错误的原因是在执行sql的时候使用了pstmt.executeQuery(sql)这个实际上是statement的方法,不支持?号占位符,所以正确的使用是pstmt.executeQuery()
本文解决了一个特定的SQL语法错误,该错误出现在使用问号作为参数占位符但调用了不支持此种占位符方法的情况下。文章详细解释了错误产生的原因,并提供了正确的执行预编译SQL语句的方法。
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 '?'
出现这种错误的原因是在执行sql的时候使用了pstmt.executeQuery(sql)这个实际上是statement的方法,不支持?号占位符,所以正确的使用是pstmt.executeQuery()
7063
5700

被折叠的 条评论
为什么被折叠?