What does the following Oracle error mean: invalid column index

后端 未结 8 1007
你的背包
你的背包 2020-12-17 08:09

I got the following error while testing some code:

SQLException: Invalid column index

What exactly does that mean?

Is

8条回答
  •  无人及你
    2020-12-17 08:35

    I also got this type error, problem is wrong usage of parameters to statement like, Let's say you have a query like this

    SELECT * FROM EMPLOYE E WHERE E.ID = ?
    

    and for the preparedStatement object (JDBC) if you set the parameters like

    preparedStatement.setXXX(1,value);
    preparedStatement.setXXX(2,value)
    

    then it results in SQLException: Invalid column index

    So, I removed that second parameter setting to prepared statement then problem solved

提交回复
热议问题