Inserting single quote in JDBC for SQL Query not working

后端 未结 1 2012
一向
一向 2021-01-28 13:19

I\'m having issues dealing with the single quote while using it in a prepared statement in JAVA via Oracle JDBC.

Let\'s say we have a table Restaurant with a column rest

1条回答
  •  清歌不尽
    2021-01-28 14:03

    The point of prepared statements is that you don't need any escaping.

    .setString(1, "Jack's Deli") will get it done.

    0 讨论(0)
提交回复
热议问题