try {
sqlQuery = URLEncoder.encode(sqlQuery,ENCODING);
json = IOUtils.toString(new URL(apiURL+sqlQuery), ENCODING);
} catch (MalformedURLException e) {
System.out.println("Could not get URL " + apiURL+sqlQuery);
throw new CartoDBException(e.getMessage());
} catch (UnsupportedEncodingException e) {
throw new CartoDBException(e.getMessage());
} catch (IOException e) {
System.out.println("Could not execute " + sqlQuery+ " on CartoDB : ");
throw new CartoDBException(e.getMessage());
}
return json;
}