Reputation: 955
I try to do a select:
Upvotes: 0
Views: 298
Reputation: 1491
You are creating PrepareStatement
object at line number 212
but you are not assigning to the prepareStatement
variable, which means prepareStatement
variable still holds old object.
At line number 213
you are using setInt()
method, it'll calls the old object. It seems your old object contains any place holders, because of the this reason you got Parameter index out of range exception
.
Assign the newly created PreparedStatement
object to prepareStatement
variable at line number 212
to resolve your problem.
Upvotes: 1
Reputation: 1259
Try it like that:
preparedStatement = connection.prepareStatement(sqlCompetition);
preparedStatement.setInt(...);
I think you have still the old statement in the variable
Upvotes: 2