How would I make a query statement with the single quotes in java. When i search a word with single quotes it show s no record to display
for example i have a name D’costa how would i search this using java
getSearchByUserSQL.append("SELECT * FROM SID_USERS ");
getSearchByUserSQL.append("WHERE lower(FIRSTNAME) like ?
OR lower(LASTNAME) like ?");
You need to escape
'with\'. Here\is a escape character.You can use String.replace to replace
'with\'.EscapeSequence in Java:
Doc Link