moved sql out of matchServlet