code: protected String escape(String pattern)
     {
        char[] chars = pattern.toCharArray();
        StringBuilder sb = new StringBuilder(chars.length + 1);
        for (int i = 0; i < chars.length; i++)
        {
           switch (chars[i])
           {
              case '\'' :
                 sb.append(getSingleQuoteEscapeSymbol());
              default :
                 sb.append(chars[i]);
           }
        }
        return sb.toString();
     }
docs: Escape all the single quote found