Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Viene ListQueryExecutionsExample
illustrato come ottenere un elenco di esecuzione IDs delle query.
package aws.example.athena;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.athena.AthenaClient;
import software.amazon.awssdk.services.athena.model.AthenaException;
import software.amazon.awssdk.services.athena.model.ListQueryExecutionsRequest;
import software.amazon.awssdk.services.athena.model.ListQueryExecutionsResponse;
import software.amazon.awssdk.services.athena.paginators.ListQueryExecutionsIterable;
import java.util.List;
/**
* Before running this Java V2 code example, set up your development
* environment, including your credentials.
*
* For more information, see the following documentation topic:
*
* https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
*/
public class ListQueryExecutionsExample {
public static void main(String[] args) {
AthenaClient athenaClient = AthenaClient.builder()
.region(Region.US_WEST_2)
.build();
listQueryIds(athenaClient);
athenaClient.close();
}
public static void listQueryIds(AthenaClient athenaClient) {
try {
ListQueryExecutionsRequest listQueryExecutionsRequest = ListQueryExecutionsRequest.builder().build();
ListQueryExecutionsIterable listQueryExecutionResponses = athenaClient
.listQueryExecutionsPaginator(listQueryExecutionsRequest);
for (ListQueryExecutionsResponse listQueryExecutionResponse : listQueryExecutionResponses) {
List<String> queryExecutionIds = listQueryExecutionResponse.queryExecutionIds();
System.out.println("\n" + queryExecutionIds);
}
} catch (AthenaException e) {
e.printStackTrace();
System.exit(1);
}
}
}