code: public static List<String> getUniqueFieldValues(Connection connection, String tableName, String fieldName) throws SQLException {
          final Statement statement = connection.createStatement();
          List<String> fieldValues = new ArrayList<String>();
          try {
              ResultSet result = statement.executeQuery("SELECT DISTINCT "+TableLocation.quoteIdentifier(fieldName)+" FROM "+TableLocation.parse(tableName));
              while(result.next()){
                  fieldValues.add(result.getString(1));
              }
          } finally {
              statement.close();
          }
          return fieldValues;
      }
docs: Returns the list of distinct values contained by a field from a table from the database
  
  @param connection Connection
  @param tableName Name of the table containing the field.
  @param fieldName Name of the field containing the values.
  @return The list of distinct values of the field.