First, do not use LCASE with LIKE unless you are case sensitive (which is not the default value in MySQL).
As for escaping these characters, just attach them with the \ character, so foo%bar will become foo\%bar .
(It has been a while since I used Java, but can this work :)
searchString.replaceAll('%', '\\\\%').replaceAll('_', '\\\\_')
(or using regex):
Regex r = new Regex('(?:%|_)', '\\\\$&'); r.replaceAll(searchString)
As for preventing SQL injection, just bind the variable as usual:
WHERE LCASE(Items.Name) LIKE ?
And create a related line like:
'%' + searchString.replaceAll('%', '\\\\%').replaceAll('_', '\\\\_') + '%'
source share