public String execute(DeleteCalendarObject deleteCalendarObject) throws SQLException{
		String answer = "";
		resultSet = queryBuilder.selectFrom("Calendars").where("CalendarName", "=", deleteCalendarObject.getCalendarToDelete()).ExecuteQuery();
		resultSet.next();
		String calendarID = resultSet.getString("calendarID");
		
		//TODO Strings here but integer in database?
		
		resultSet = queryBuilder.selectFrom("Users").where("UserName", "=", deleteCalendarObject.getuserID()).ExecuteQuery();
		resultSet.next();
		int userID = resultSet.getInt("userID");
				
		boolean author = false;
		boolean imported = true;
		resultSet = queryBuilder.selectFrom("Calendars").where("calendarID", "=", calendarID).ExecuteQuery();
		if(resultSet.next()){
			if(resultSet.getInt("imported") == 0){
				imported = false;
			}
		}
		
		
		
		
		if(imported == false){
			resultSet = queryBuilder.selectFrom("AutherRights").where("CalendarID", "=", calendarID).ExecuteQuery();

			while(resultSet.next()){

				//TODO Check if resultset is used correctly
				if(resultSet.getInt("userID") == userID){
					author = true;
				}
			}

			if(author){
				
				resultSet = queryBuilder.selectFrom("Events").where("CalendarID", "=", calendarID).ExecuteQuery();
				while(resultSet.next()){
					String eventID = resultSet.getString("eventID");
					try{
					queryBuilder.deleteFrom("Notes").where("eventID", "=", eventID);
					}catch(Exception e){
						System.err.print(e.getStackTrace());
					}
				}
				
				queryBuilder.deleteFrom(dbConfig.getEvents()).where("CalendarID", "=", calendarID).Execute();
				queryBuilder.deleteFrom("subscription").where("CalendarID", "=", calendarID).Execute();
				queryBuilder.deleteFrom("autherrights").where("CalendarID", "=", calendarID).Execute();
				queryBuilder.deleteFrom(dbConfig.getCalendar()).where("CalendarID", "=", calendarID).Execute();
								
				answer = String.format("Calendar " + deleteCalendarObject.getCalendarToDelete() + " has been deleted, along with all associated events and notes.");

			}else{
				answer = "You do not have the rights to delete this calendar.";
			}
		}else{
			answer = "This is an imported calendar and cannot be deleted.";
		}
		return answer;
	}