I have a query:
SELECT * FROM table_name WHERE name=? surname=? gender=?;
and I have to inject the strings into the query (I use the prepared statement) but the problem is that these 3 clauses are variable; I can have 0, 1, or also all 3 clauses active based on the input that the user do.
How can I "ignore" each of them if the user doesn't input anything for it?
Thanks to all!
EDIT: it's also good if anyone know how to setStrin() to a preparedStatement without let him to put ' '
around the string.