public  Object getAggregateColumnValue(String table, Column column, QUERY_TYPE aggregate) throws SQLException, NoValueException{
		
		Object res = new Object();
				
		Statement s = DBAccess.getConnection().createStatement();
		
		String query = "SELECT " + aggregate + "(" + column.getColumnName() + ") FROM " + table + " ;";

		ResultSet r = s.executeQuery(query);
		
		if(r.next() && res != null) {
			
					do{
						res = r.getObject(1);
					}while(r.next());
					
		} else if(res == null){
			
					String aggVal = "";
					
					aggVal = (aggregate == QUERY_TYPE.MAX) ?  "Massimo" : "Minimo";
					
					throw new NoValueException("Errore! - Impossibile calcolare: " + aggVal + " sulla colonna: " + column.getColumnName());
					
				}else
					
					throw new NoValueException("Errore! - Risultato della query vuoto, nessuna tupla!");
		
		r.close();
		
		return res;
	}