I have a jsp-form with field named Description
. This field declared as follows
<input type="text" name="description">
This value used to compose SQL query:
select * from Engines where description like '% (Value from the field)%'
When a user enters alphanumeric characters it works fine, but it fails when user enters special characters, like single quote symbol: '
My questions:
- How can I deal with this on the server-side
- If it is necessary to implement on JavaScript, then what characters have to be filtered out?
Thank you.