According to this document (see the bottom of the page), you can define your own escape character:
Apparently the exact syntax for specifying the escape character differs among databases and JDBC provides this mechanism to abstract from these differences. I've never used that myself, though; I don't need database agnostic code and therefore always use the native syntax of my database.
You can use whatever escape character you wish. I didn't go for the obvious backslash, since it has to be escaped in Java String literals themselves, which makes somewhat less obvious what is actually happening.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Preparedstatement with like where clause and the field contain %, how to escape?