Building the Connection URL

Use the connection URL to supply connection information to the data store that you are accessing. The following is the format of the connection URL for the Simba Amazon Athena JDBC Connector:

jdbc:awsathena://User=[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

The following variables are used in the example connection strings:

  • [Region] is the AWS region of the Athena instance that you want to connect to.
  • [AccessKey] is the access key provided by your AWS account.
  • [SecretKey] is the secret key provided by your AWS account.
  • [Output] is the path of the Amazon S3 location where you want to store query results, prefixed by s3://.
  • [Property1..N] and [Value1..N] are additional connection properties supported by the connector. For a list of the properties available in the connector, see Driver Configuration Options on page 1.
Important:
  • Properties are case-sensitive.
  • Do not duplicate properties in the connection URL.

Standard Connection String

The following is the format of the connection URL for the Simba Amazon Athena JDBC Connector:

jdbc:awsathena://AwsRegion=[Region];User=[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

For example, to connect to Athena and authenticate the connection using a user name and password, you would use the following connection URL:

jdbc:awsathena://AwsRegion=us-west-1;User=FJ4EK9SEO2KFk;Password=P9PcyQ7prK2LwUMZMpFQ4R+5VE;S3OutputLocation=s3://working/dir;

Using an Endpoint URL

The connector supports two types of endpoint URLs: a default endpoint format, and a VPC endpoint format.

The following is the format of a connection URL using the default endpoint format.

jdbc:awsathena://athena.[Region].amazonaws.com:443;User=[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

For example, to connect to Athena using a standard endpoint, you would use the following connection URL:

jdbc:awsathena://athena.us-east-1.com:443;User=FJ4EK9SEO2KFk;Password=P9PcyQ7prK2LwUMZMpFQ4R+5VE;S3OutputLocation=s3://working/dir;

The following is the format of a connection URL using the VPC endpoint format.

jdbc:awsathena://[vpce-specific-url].athena.[Region].amazonaws.com:443;User=[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

For example, to connect to Athena using a VPC endpoint, you would use the following connection URL:

jdbc:awsathena://vpce-73hddf25rus619fh62-8wnf52jd-eu-west-2a.athena.eu-west-2.vpce.amazonaws.com:443;User=FJ4EK9SEO2KFk;Password=P9PcyQ7prK2LwUMZMpFQ4R+5VE;S3OutputLocation=s3://working/dir;

Note:

If the endpoint is specified in the URL, as shown in the examples above, then the AwsRegion property should not be used.

Using Endpoint Overrides

The Athena endpoint can also be specified in the EndpointOverride connection property.

The following are two possible formats for connection URLs where the endpoint is specified in the EndpointOverride connection property. The first uses a default endpoint, while the second uses a VPC endpoint.

Default endpoint:

jdbc:awsathena://EndpointOverride=athena.[Region].amazonaws.com:443;User=[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

VPC endpoint:

jdbc:awsathena://EndpointOverride=[vpce-specific-url].athena.[Region].vpce.amazonaws.com:443;User=[AccessKey];
Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

Note:

If endpoints are specified in both the URL and the EndpointOverride connection property, the endpoint in the connection property takes precedence.

Additionally, if you are using the Athena streaming service, but are not using the default endpoint for this service, you can use the StreamingEndpointOverride connection property to specify the necessary endpoint.

The following is the format of a connection URL that uses a VPC endpoint and specifies the StreamingEndpointOverride property:

jdbc:awsathena://[vpce-specific-url].athena.[Region].vpce.amazonaws.com:443;StreamingEndpointOverride=[StreamingEndpoint]User=[AccessKey];Password=[SecretKey];S3OutputLocation=[Output];[Property1]=[Value1];[Property2]=[Value2];...

Note:

Typically, the StreamingEndpointOverride property is not required. If this property is not specified, the connector tries to access the Athena streaming service using port 444 of the specified Athena instance.