code: public static String isValidSqlWithMessage(Connection con, Report report) {
  		String sql = getSql(report);
  		List<QueryParameter> parameters = report.getParameters();
  		String message = isValidSqlWithMessage(con, sql, parameters);
  		if (message == null) {
  			for (QueryParameter qp : parameters) {
  				if (qp.isManualSource()) {
  					String parMessage = isValidSqlWithMessage(con, qp.getSource(), parameters);
  					if (parMessage != null) {
  						parMessage = "Parameter '" + qp.getName() + "'\n" + parMessage;
  						return parMessage;
  					}
  				}
   			}
  		} 
  		return message;		
  	}
docs: Test if sql from a report object and sql from all parameter sources (if any) are valid
  
  @param con database connection
  @param report report object
  @return return message error if sql is not valid, null otherwise