Using Athena with the JDBC driver
You can use a JDBC connection to connect Athena to business intelligence tools and other
applications, such as SQL workbench
JDBC driver with AWS SDK
The JDBC driver version 2.0.31 complies with the JDBC API 4.1 and 4.2 data
standards. For information about checking the version of Java Runtime Environment (JRE)
that you use, see the Java documentation
Download the driver that matches your version of the JDK and the JDBC data standards:
-
The AthenaJDBC41.jar
is compatible with JDBC 4.1 and requires JDK 7.0 or later. -
The AthenaJDBC42.jar
is compatible with JDBC 4.2 and requires JDK 8.0 or later.
The following .zip
file download contains the
.jar
files for JDBC 4.1 and 4.2 and includes the AWS
SDK.
JDBC driver without AWS SDK
The JDBC driver version 2.0.31 complies with the JDBC API 4.1 and 4.2 data
standards. For information about checking the version of Java Runtime Environment (JRE)
that you use, see the Java documentation
Download the driver that matches your version of the JDK and the JDBC data standards. These files do not include the AWS SDK:
-
The AthenaJDBC41.jar
is compatible with JDBC 4.1 and requires JDK 7.0 or later. -
The AthenaJDBC42.jar
is compatible with JDBC 4.2 and requires JDK 8.0 or later.
The following .zip
file download contains the
.jar
files for JDBC 4.1 and 4.2. It does not include the AWS
SDK.
JDBC driver release notes, license agreement, and notices
After you download the version you need, read the release notes, and review the License Agreement and Notices.
JDBC driver documentation
Download the following documentation for the driver:
-
JDBC driver installation and configuration guide
. Use this guide to install and configure the driver. -
JDBC driver migration guide
. Use this guide to migrate from previous versions to the current version.
To use the JDBC driver for multiple data catalogs with Athena (for example, when
using an external Hive metastore or
federated queries), include
MetadataRetrievalMethod=ProxyAPI
in your JDBC connection
string.
Migration from previous version of the JDBC driver
The current JDBC driver version 2.0.31 is a drop-in replacement of the previous version of the JDBC driver, and is backwards compatible with previous 2.x versions, with the following step that you must perform to ensure the driver runs.
To use JDBC driver version 2.0.5 or later, attach a permissions policy to IAM
principals using the JDBC driver that allows the
athena:GetQueryResultsStream
policy action. This policy action is
not exposed directly with the API. It is only used with the JDBC driver as part of
streaming results support. For an example policy, see AWS managed policy:
AWSQuicksightAthenaAccess.
Additionally, ensure that port 444, which Athena uses to stream query results, is
open to outbound traffic. When you use a PrivateLink endpoint to connect to Athena,
ensure that the security group attached to the PrivateLink endpoint is open to
inbound traffic on port 444. If port 444 is blocked, you may receive the error
message [Simba][AthenaJDBC](100123) An error has occurred. Exception
during column initialization
.
For more information about upgrading to versions 2.0.5 or later from version
2.0.2, see the JDBC driver migration guide
For more information about the previous versions of the JDBC driver, see Using earlier version JDBC drivers.
If you are migrating from a 1.x driver to a 2.x driver, you must migrate your existing
configurations to the new configuration. We highly recommend that you migrate to driver
version 2.x. For information, see the JDBC driver migration guide