We connect to AWS through our office365 users given to us by our company. Since we assume a role in the UI, how would I connect to Athena from a JDBC tool like DataGrip?
Asked
Active
Viewed 989 times
2 Answers
0
If you want to use JDBC for Athena then you can have the connection string as shown below and your access key credentials as user name and password.
jdbc:awsathena://athena.{REGION}.amazonaws.com:443
Or
jdbc:awsathena://AwsRegion={REGION}
Please refer to this and this which helps you in configuring the connection and run queries from DataGrip.

Prabhakar Reddy
- 4,628
- 18
- 36
0
Use "com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain". This class trying to load credential from different provider one by one until it get success.
More detail about Simba athena lib - simba athena lib
Sample code for referene:
PoolConfiguration configuration = ((org.apache.tomcat.jdbc.pool.DataSource) dataSource).getPoolProperties();
Properties properties = new Properties();
properties.put("S3OutputLocation", "s3://bucket-name/folder/");
properties.setProperty("AwsCredentialsProviderClass", "com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain");
configuration.setDbProperties(properties);
JdbcTemplate template = new JdbcTemplate(dataSource);

027
- 1,553
- 13
- 23