Invalid column index using PreparedStatement

后端 未结 2 1589
误落风尘
误落风尘 2021-01-28 01:35

I am trying to query same data. But the preparedStatement thrown an SQLException about wrong indexing even though the index start from 1 as the documentation said.

Here

2条回答
  •  伪装坚强ぢ
    2021-01-28 01:59

    Print out the query string before executing it:

    SELECT title, registered FROM paperWHERE title LIKE '%?%'
    

    The answer should be obvious.

    You need spaces to delimit keywords.

提交回复
热议问题