Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] Add examples for how to specify driver properties #1160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/using-the-jdbc-driver/UsingTheJdbcDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,57 @@ For `application.properties`:
logging.level.software.amazon.jdbc=trace
```

## Specifying Parameter Values
There are multiple ways to configure parameters for the AWS JDBC Driver,
depending on how the driver is instantiated.

### Spring + HikariCP
HikariCP passes parameters to the driver using the configuration key:
`spring.datasource.hikari.data-source-properties`.

**Examples**:

application.yaml:
```yaml
spring:
datasource:
hikari:
data-source-properties:
wrapperPlugins: failover,efm2
wrapperDialect: aurora-pg
```
application.properties
```
spring.datasource.hikari.data-source-properties.wrapperPlugins=failover,efm2
spring.datasource.hikari.data-source-properties.wrapperDialect
```
Environment Variable (SPRING_APPLICATION_JSON)
```json
{
"spring.datasource.hikari.data-source-properties.wrapperPlugins": "failover,efm2",
"spring.datasource.hikari.data-source-properties.wrapperDialect": "aurora-pg"
}
```

### DriverManager
When specifying a DataSource using DriverManager, parameters may be specified
in the query section of the JDBC URL.

```
url=jdbc:aws-wrapper:postgresql://<host_name>?[paramOne=valueOne[&paramTwo=valueTwo...]]
```

For example:
```
url=jdbc:aws-wrapper:postgresql://db.example.com?database=example&tcpKeepAlive=true
```

> [!NOTE]
> When connecting to a MS SQL Server engine, standard URL parameter notation is
> required. The driver will not parse parameters specified after semi-colons in
> the traditional MSSQL URL format.


## AWS Advanced JDBC Driver Parameters
These parameters are applicable to any instance of the AWS JDBC Driver.

Expand Down