java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)
时间: 2023-11-07 11:24:00 浏览: 131
java 索引越界异常(IndexOutOfBoundsException)
This exception occurs when there are fewer parameters specified in the SQL statement than the number of parameters being supplied.
For example, if the SQL statement has no parameters specified, but the Java code is trying to set a parameter using PreparedStatement.setXXX() method, then this exception will be thrown.
To fix this issue, make sure that the number of parameters in the SQL statement matches the number of parameters being supplied, and that they are in the correct order. Also, ensure that you are using the correct method to set the parameter value.
阅读全文