

# Advanced connection parameters

The following sections describe the advanced connection parameters for the JDBC 4.x driver.

**Topics**
+ [Result encryption parameters](#jdbc-v4-driver-result-encryption-parameters)
+ [Result fetching parameters](#jdbc-v4-driver-result-fetching-parameters)
+ [Result configuration parameters](#jdbc-v4-driver-result-config)
+ [Query result reuse parameters](#jdbc-v4-driver-query-result-reuse-parameters)
+ [Query execution polling parameters](#jdbc-v4-driver-query-execution-polling-parameters)
+ [Endpoint override parameters](#jdbc-v4-driver-endpoint-override-parameters)
+ [Proxy configuration parameters](#jdbc-v4-driver-proxy-configuration-parameters)
+ [Logging parameters](#jdbc-v4-driver-logging-parameters)
+ [Application name](#jdbc-v4-driver-application-name)
+ [ConnectionTest](#jdbc-v4-driver-connection-test)
+ [Number of retries](#jdbc-v4-driver-number-of-retries)
+ [Network timeout](#jdbc-v4-driver-networktimeoutmillis)
+ [Logging configuration](#jdbc-v4-driver-logging-migration)
+ [GlueEndpoint](#jdbc-v4-driver-glue-endpoint)
+ [LegacyModes](#jdbc-v4-driver-legacy-modes)
+ [Host and endpoint precedence](#jdbc-v4-driver-host-endpoint)

## Result encryption parameters
<a name="jdbc-v4-driver-result-encryption-parameters"></a>

Note the following points:
+ The Amazon KMS Key must be specified when `EncryptionOption` is `SSE_KMS` or `CSE_KMS`.
+ The Amazon KMS Key cannot be specified when `EncryptionOption` is not specified or when `EncryptionOption` is `SSE_S3`.

### Encryption option
<a name="jdbc-v4-driver-encryption-option"></a>

The type of encryption to be used for query results as they are stored in Amazon S3. For information about query result encryption, see [EncryptionConfiguration](https://docs.amazonaws.cn/athena/latest/APIReference/API_EncryptionConfiguration.html) in the *Amazon Athena API Reference*.



| Parameter name | Alias | Parameter type | Default value | Possible values | 
| --- | --- | --- | --- | --- | 
| EncryptionOption | S3OutputEncOption (deprecated) | Optional | none | SSE\_S3, SSE\_KMS, CSE\_KMS | 

### KMS Key
<a name="jdbc-v4-driver-kms-key"></a>

The KMS key ARN or ID, if `SSE_KMS` or `CSE_KMS` is chosen as the encryption option. For more information, see [EncryptionConfiguration](https://docs.amazonaws.cn/athena/latest/APIReference/API_EncryptionConfiguration.html) in the *Amazon Athena API Reference*.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| KmsKey | S3OutputEncKMSKey (deprecated) | Optional | none | 

## Result fetching parameters
<a name="jdbc-v4-driver-result-fetching-parameters"></a>

### ResultFetcher
<a name="jdbc-v4-driver-result-fetcher"></a>

The default `ResultFetcher` value is `auto`. The following table lists the accepted explicit fetchers for each engine and result storage.

The names `GetQueryResultStream` and `GetQueryResultsStream` select different APIs. Use the singular `Result` spelling for the DuckDB Arrow stream.

The following table shows which explicit fetchers the driver accepts for each engine and result storage.



| Fetcher | Engine version 3 | DuckDB, managed results | DuckDB, S3 results | 
| --- | --- | --- | --- | 
| GetQueryResults | Accepted | Accepted | Accepted | 
| GetQueryResultStream | Rejected | Accepted | Rejected | 
| GetQueryResultsStream | Accepted | Rejected | Rejected | 
| S3 | Accepted | Rejected | Accepted | 
| S3V2 | Accepted | Rejected | Rejected | 

The `GetQueryResultStream` fetcher requires usable Arrow buffers. For information about configuring the JVM, see [Configure the JVM for Arrow](jdbc-v4-driver-getting-started.md#jdbc-v4-driver-arrow-jvm-configuration).

With `auto`, DuckDB queries using Athena-managed results use `GetQueryResultStream` when Arrow buffers are available, and `GetQueryResults` otherwise.

With `auto`, DuckDB queries whose results are in an S3 bucket use the S3 fetcher. The driver uses `GetQueryResults` instead for `CSE_KMS` encryption or when opening S3 results returns `AccessDenied`.

For engine version 3, `auto` uses `GetQueryResultsStream` with Athena-managed results and S3 with bucket results. The S3 fetcher falls back to `GetQueryResultsStream` for `CSE_KMS` or `AccessDenied`.

### Fetch size
<a name="jdbc-v4-driver-fetch-size"></a>

For `GetQueryResults`, this parameter controls the number of rows initially requested by the result buffer. For `GetQueryResultsStream` and `S3`, it also sets the target page size. The value `0` uses the driver defaults described below. The maximum value is 1,000,000.

The Arrow `GetQueryResultStream` fetcher does not use `FetchSize` to control its batch size or buffering. Its queue holds up to two Arrow batches.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| FetchSize | RowsToFetchPerBlock (deprecated) | Optional | 0 | 
+ The `GetQueryResults` fetcher does not set `MaxResults` in its requests. The API accepts a maximum of 1,000 rows per request. The driver uses the returned pagination token to fetch additional pages when the result buffer needs more rows.
+ The `GetQueryResultsStream` fetcher will use the configured fetch size as the page size, or 10,000 by default.
+ The `S3` fetcher will use the configured fetch size as the page size, or 10,000 by default.

## Result configuration parameters
<a name="jdbc-v4-driver-result-config"></a>

### Expected bucket owner
<a name="jdbc-v4-driver-exp-bucket-owner"></a>

The account ID of the expected s3 bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails. For more information about verifying s3 bucket owner, see [Verifying bucket ownership](https://docs.amazonaws.cn/AmazonS3/latest/userguide/bucket-owner-condition.html#bucket-owner-condition-use).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ExpectedBucketOwner | none | Optional | none | 

### Acl option
<a name="jdbc-v4-driver-acl"></a>

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. For more information about `AclOption`, see [AclConfiguration](https://docs.amazonaws.cn/athena/latest/APIReference/API_AclConfiguration.html).



| Parameter name | Alias | Parameter type | Default value | Possible values | 
| --- | --- | --- | --- | --- | 
| AclOption | none | Optional | none | BUCKET\_OWNER\_FULL\_CONTROL | 

## Query result reuse parameters
<a name="jdbc-v4-driver-query-result-reuse-parameters"></a>

### Enable result reuse
<a name="jdbc-v4-driver-enable-result-reuse"></a>

Specifies whether previous results for the same query can be reused when a query is run. For information about query result reuse, see [ResultReuseByAgeConfiguration](https://docs.amazonaws.cn/athena/latest/APIReference/API_ResultReuseByAgeConfiguration.html).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| EnableResultReuseByAge | none | Optional | FALSE | 

### Result reuse max age
<a name="jdbc-v4-driver-result-reuse-max-age"></a>

The maximum age, in minutes, of a previous query result that Athena should consider for reuse. For information about result reuse max age, see [ResultReuseByAgeConfiguration](https://docs.amazonaws.cn/athena/latest/APIReference/API_ResultReuseByAgeConfiguration.html).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| MaxResultReuseAgeInMinutes | none | Optional | 60 | 

## Query execution polling parameters
<a name="jdbc-v4-driver-query-execution-polling-parameters"></a>

### Minimum query execution polling interval
<a name="jdbc-v4-driver-minimum-query-execution-polling-interval"></a>

The minimum time, in milliseconds, to wait before polling Athena for the query execution status.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| MinQueryExecutionPollingIntervalMillis | MinQueryExecutionPollingInterval (deprecated) | Optional | 100 | 

### Maximum query execution polling interval
<a name="jdbc-v4-driver-maximum-query-execution-polling-interval"></a>

The maximum time, in milliseconds, to wait before polling Athena for the query execution status.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| MaxQueryExecutionPollingIntervalMillis | MaxQueryExecutionPollingInterval (deprecated) | Optional | 5000 | 

### Query execution polling interval multiplier
<a name="jdbc-v4-driver-query-execution-polling-interval-multiplier"></a>

The factor for increasing the polling period. By default, polling will begin with the value for `MinQueryExecutionPollingIntervalMillis` and double with each poll until it reaches the value for `MaxQueryExecutionPollingIntervalMillis`.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| QueryExecutionPollingIntervalMultiplier | none | Optional | 2 | 

## Endpoint override parameters
<a name="jdbc-v4-driver-endpoint-override-parameters"></a>

### Athena endpoint override
<a name="jdbc-v4-driver-athena-endpoint-override"></a>

You can specify the endpoint that you want the driver to use to make API calls to Athena.

Note the following points:
+ If a scheme is omitted, the driver adds the `https://` prefix. Explicit endpoint overrides must use HTTPS.
+ If this parameter is not specified, the driver uses a default endpoint.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| AthenaEndpoint | Endpoint; EndpointOverride (deprecated) | Optional | none | 

### Athena streaming service endpoint override
<a name="jdbc-v4-driver-athena-streaming-service-endpoint-override"></a>

The endpoint used by the legacy `GetQueryResultsStream` fetcher to download query results. Its default streaming port is 444. The `GetQueryResultStream` Arrow fetcher uses the Athena API endpoint configuration.

Note the following points:
+ If a scheme is omitted, the driver adds the `https://` prefix. Explicit endpoint overrides must use HTTPS.
+ If a port is not specified in the provided URL, the driver inserts the streaming service port 444.
+ If `AthenaStreamingEndpoint` is absent and `AthenaEndpoint` has no port or uses port 443, the driver constructs the legacy streaming endpoint with port 444. An `AthenaEndpoint` override with a different port does not produce an automatic legacy streaming override. When no endpoint override is set, the driver uses its default legacy streaming endpoint.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| AthenaStreamingEndpoint | StreamingEndpoint; StreamingEndpointOverride (deprecated) | Optional | none | 

### LakeFormation endpoint override
<a name="jdbc-v4-driver-athena-lake-formation-endpoint-override"></a>

The endpoint that the driver will use for the Lake Formation service when using the Amazon Lake Formation [AssumeDecoratedRoleWithSAML](https://docs.amazonaws.cn/lake-formation/latest/APIReference/API_AssumeDecoratedRoleWithSAML.html) API to retrieve temporary credentials. If this parameter is not specified, the driver uses a default Lake Formation endpoint.

Note the following points:
+ If a scheme is omitted, the driver adds the `https://` prefix. Explicit endpoint overrides must use HTTPS.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| LakeFormationEndpoint | LfEndpointOverride (deprecated) | Optional | none | 

### S3 endpoint override
<a name="jdbc-v4-driver-athena-s3-endpoint-override"></a>

The endpoint that the driver will use to download query results when it uses the Amazon S3 fetcher. If this parameter is not specified, the driver uses a default Amazon S3 endpoint.

Note the following points:
+ If a scheme is omitted, the driver adds the `https://` prefix. Explicit endpoint overrides must use HTTPS.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| S3Endpoint | None | Optional | none | 

### STS endpoint override
<a name="jdbc-v4-driver-athena-sts-endpoint-override"></a>

The endpoint that the driver will use for the Amazon STS service when using the Amazon STS [AssumeRoleWithSAML](https://docs.amazonaws.cn/STS/latest/APIReference/API_AssumeRoleWithSAML.html) API to retrieve temporary credentials. If this parameter is not specified, the driver uses a default Amazon STS endpoint.

Note the following points:
+ If a scheme is omitted, the driver adds the `https://` prefix. Explicit endpoint overrides must use HTTPS.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| StsEndpoint | StsEndpointOverride(deprecated) | Optional | none | 

### SSO OIDC endpoint override
<a name="jdbc-v4-driver-athena-sso-oidc-endpoint-override"></a>

The endpoint URI passed to the Amazon SDK for Java `SsoOidcClient` builder to override its default SSO OIDC service endpoint. For information about endpoint overrides, see [Setting the Amazon Region and endpoint](https://docs.amazonaws.cn/sdk-for-java/latest/developer-guide/region-selection.html).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| SsoOidcEndpoint |  | Optional | none | 

### SSO Admin endpoint override
<a name="jdbc-v4-driver-athena-sso-admin-endpoint-override"></a>

The endpoint URI passed to the Amazon SDK for Java `SsoAdminClient` builder to override its default SSO Admin service endpoint. For information about endpoint overrides, see [Setting the Amazon Region and endpoint](https://docs.amazonaws.cn/sdk-for-java/latest/developer-guide/region-selection.html).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| SsoAdminEndpoint |  | Optional | none | 

### SSO endpoint override
<a name="jdbc-v4-driver-athena-sso-endpoint-override"></a>

The endpoint URI passed to the Amazon SDK for Java `SsoClient` builder to override its default SSO service endpoint. For information about endpoint overrides, see [Setting the Amazon Region and endpoint](https://docs.amazonaws.cn/sdk-for-java/latest/developer-guide/region-selection.html).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| SsoEndpoint |  | Optional | none | 

## Proxy configuration parameters
<a name="jdbc-v4-driver-proxy-configuration-parameters"></a>

### Proxy host
<a name="jdbc-v4-driver-proxy-host"></a>

The URL of the proxy host. Use this parameter if you require Athena requests to go through a proxy.

**Note**  
The `ProxyHost` value can include an `http://` or `https://` scheme. If the scheme is omitted, the driver uses HTTPS.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProxyHost | none | Optional | none | 

### Proxy port
<a name="jdbc-v4-driver-proxy-port"></a>

The port to be used on the proxy host. Use this parameter if you require Athena requests to go through a proxy.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProxyPort | none | Optional | none | 

### Proxy username
<a name="jdbc-v4-driver-proxy-username"></a>

The username to authenticate on the proxy server. Use this parameter if you require Athena requests to go through a proxy.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProxyUsername | ProxyUID (deprecated) | Optional | none | 

### Proxy password
<a name="jdbc-v4-driver-proxy-password"></a>

The password to authenticate on the proxy server. Use this parameter if you require Athena requests to go through a proxy.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProxyPassword | ProxyPWD (deprecated) | Optional | none | 

### Proxy-exempt hosts
<a name="jdbc-v4-driver-proxy-exempt-hosts"></a>

A set of host names that the driver connects to without using a proxy when proxying is enabled (that is, when the `ProxyHost` and `ProxyPort` connection parameters are set). The hosts should be separated by the pipe (`|`) character (for example, `host1.com|host2.com`).



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProxyExemptHosts | NonProxyHosts | Optional | none | 

### Proxy enabled for identity providers
<a name="jdbc-v4-driver-proxy-enabled-for-identity-providers"></a>

Controls whether the driver applies its proxy connection parameters to identity-provider HTTP requests for `AzureAD`, `BrowserAzureAD`, `Okta`, `Ping`, and `ADFS`.

The `BrowserOidcTip` provider uses `ProxyHost` and `ProxyPort` for its driver HTTP requests independently of `ProxyEnabledForIdP`.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProxyEnabledForIdP | UseProxyForIdP | Optional | FALSE | 

## Logging parameters
<a name="jdbc-v4-driver-logging-parameters"></a>

This section describes parameters related to logging.

### LogLevel
<a name="jdbc-v4-driver-logging-parameters-log-level"></a>

Set `LogPath` to enable driver file logging. `LogLevel` defaults to `TRACE` and accepts `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`. The driver also emits messages through SLF4J, configured by your application.

### Log path
<a name="jdbc-v4-driver-logging-parameters-log-path"></a>

The path to a directory on the computer that runs the driver where driver logs are stored. Setting this parameter enables file logging. The file name contains a timestamp and a four-character identifier.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| LogPath | none | Optional | none | 

## Application name
<a name="jdbc-v4-driver-application-name"></a>

The name of the application that uses the driver. If a value for this parameter is specified, the value is included in the user agent string of the API calls that the driver makes to Athena.

**Note**  
You can also set the application name by calling `setApplicationName` on the `DataSource` object.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ApplicationName | none | Optional | none | 

## ConnectionTest
<a name="jdbc-v4-driver-connection-test"></a>

The default `ConnectionTest=true` submits `SELECT 1` each time a connection is created. Set it to `false` to skip that query. The workgroup configuration lookup and engine/fetcher validation still occur.

The following table describes connection testing.



| Parameter | Default | Behavior | 
| --- | --- | --- | 
| ConnectionTest | true | Enables the initial SELECT 1 query. | 

## Number of retries
<a name="jdbc-v4-driver-number-of-retries"></a>

The maximum number of times the driver should resend a retriable request to Athena.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| NumRetries | MaxErrorRetry (deprecated) | Optional | none | 

## Network timeout
<a name="jdbc-v4-driver-networktimeoutmillis"></a>

`NetworkTimeoutMillis` configures the HTTP connection acquisition timeout and the driver timeout used while waiting for API operations, including the workgroup lookup. Calling `Connection.setNetworkTimeout` changes the same driver timeout.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| NetworkTimeoutMillis | none | Optional | none | 

## Logging configuration
<a name="jdbc-v4-driver-logging-migration"></a>

JDBC 4.x does not define `MaxFileSize` or `MaxFileCount` connection parameters. Configure file logging with `LogPath` and `LogLevel`.

The driver supports SLF4J logging and optional file logging through `LogPath` and `LogLevel`. Its file appender creates a log file with a timestamp and identifier when started.

## GlueEndpoint
<a name="jdbc-v4-driver-glue-endpoint"></a>

Use `GlueEndpoint` to override the Glue client endpoint for metadata requests. When it is unset, the driver uses the regional service endpoint.

The following table describes glue endpoint.



| Parameter | Default | Behavior | 
| --- | --- | --- | 
| GlueEndpoint | Unset | Endpoint URI for Glue requests. | 

## LegacyModes
<a name="jdbc-v4-driver-legacy-modes"></a>

The optional `LegacyModes` parameter is a comma-separated set of compatibility modes for result parsing. An empty value selects no modes. The `SplitPlainTextResults` mode splits plain-text results into columns; it is deprecated and can produce incorrect query results.

## Host and endpoint precedence
<a name="jdbc-v4-driver-host-endpoint"></a>

The URL host supplies the Athena endpoint through `Host`. Do not supply both a host and `AthenaEndpoint`: the connection fails validation. Endpoint overrides require HTTPS; the driver adds `https://` when a scheme is omitted.