Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Code samples

Focus mode
Code samples - Amazon Athena

The examples in this topic use SDK for Java 2.x as a starting point for writing Athena applications.

Note

For information about programming Athena using other language-specific AWS SDKs, see the following resources:

For more information about running the Java code examples in this section, see the Amazon Athena Java readme on the AWS code examples repository on GitHub. For the Java programming reference for Athena, see AthenaClient in the AWS SDK for Java 2.x.

Note

These samples use constants (for example, ATHENA_SAMPLE_QUERY) for strings, which are defined in an ExampleConstants.java class declaration. Replace these constants with your own strings or defined constants.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.