Added a switch to querySql to the type of sql (select or update/insert)