Issue is with EscapeTokenizer.java in mysql-connector-java-5.1.7. Apostrophe in comment is not properly interpreted.
This works fine with mysql-connector-java-5.1.49. If upgrade is not an option, you will have to remove or escape the apostrophe in comment.