Avoiding% and _ in a SQL predicate
The following code for finding particle data in a map does not work if the searchWord contains %, ', _, etc.
StringBuilder fullQuery= new StringBuilder().
append("Name like \'").append(searchWord).
append("%\'");
List<Person> persons = (List<Person>) personMap
.values(new SqlPredicate(fullQuery));
How can I use these symbols for the actual match.
+3
source to share