Parameter index out of range (1 > number of parameters, which is 0).
程序员文章站
2022-07-12 13:34:22
...
Exception:Parameter index out of range (1 > number of parameters, which is 0).
在使用jdbc是出现这个错误,原因是在使用占位符(?)的时候,用单引号括起来了,这个问题在拼接复杂sql语句的时候常常出现。
错误:SELECT * FROM doctor WHERE docName = '?'
正确:SELECT * FROM doctor WHERE docName = ?
推荐阅读
-
java.sql.SQLException: Parameter index out of range (1 > number of parameters, w 博客分类: java细节
-
Parameter index out of range (1 > number of parameters, which is 0).
-
Parameter index out of range (1 > number of parameters, which is 0).
-
Parameter index out of range (10 > number of parameters, which is 9).报错解决
-
java.sql.SQLException: Parameter index out of range (1 > number of parameters, w