queryStr.append("\\\\%AMPAMP\\\\$");
after executing this line the querStr removes
one \ from the string and the final result will be:
"\%AMPAMP\$"
I want it to be:
\\\\%AMPAMP\\\\$
You have to escape the slash:
queryStr.append("\\\\%AMPAMP\\\\$");