How do I escape a literal question mark ('?') in a JDBC prepared statement

前端 未结 5 1817
醉酒成梦
醉酒成梦 2021-02-19 10:56

I\'d like to create a JDBC PreparedStatement like:

SELECT URL,LOCATE ( \'?\', URL ) pos FROM Links WHERE pageId=? ORDER BY pos ASC

Where the 1s

5条回答
  •  日久生厌
    2021-02-19 11:30

    Did you try it? I think quoted question marks are OK. only "bare" question marks should get replaced in the prepared statement

提交回复
热议问题