Inserting single quote in JDBC for SQL Query not working
问题 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 restaurant_name with 1 value : Jack's Deli I want to use a simple prepared statement query like this: String result = "Jack\'\'s Deli" String sqlStatement = "select * from Restaurant where restauraunt_name like ? escape '\\' "; PreparedStatement pStmt = conn.prepareStatement(sqlStatement); pstmt.setString(1, result); The result