I've always had trouble trying to store URL strings into a mysql database ..... Retrieval by a search query is also problematic.
Try using URLEncoder to convert a URL string to a more useable format before inserting it into mysql.
You'll also need URLDecoder most likely.
the problem might be that // is in some engines treated as comment and APE is stripping comments before executing any SQL script. If you can execute this script against your DB directly then it's obviously a bug on my side. Would be so kind and file Jira ticket if that is the case?