Skip to content

Commit b8dbfa5

Browse files
author
Brian Shacklett
committed
Add property spec examples
1 parent 90543f0 commit b8dbfa5

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/using-the-jdbc-driver/UsingTheJdbcDriver.md

+51
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,57 @@ For `application.properties`:
6969
logging.level.software.amazon.jdbc=trace
7070
```
7171

72+
## Specifying Parameter Values
73+
There are multiple ways to configure parameters for the AWS JDBC Driver,
74+
depending on how the driver is instantiated.
75+
76+
### Spring + HikariCP
77+
HikariCP passes parameters to the driver using the configuration key:
78+
`spring.datasource.hikari.data-source-properties`.
79+
80+
**Examples**:
81+
82+
application.yaml:
83+
```yaml
84+
spring:
85+
datasource:
86+
hikari:
87+
data-source-properties:
88+
wrapperPlugins: failover,efm2
89+
wrapperDialect: aurora-pg
90+
```
91+
application.properties
92+
```
93+
spring.datasource.hikari.data-source-properties.wrapperPlugins=failover,efm2
94+
spring.datasource.hikari.data-source-properties.wrapperDialect
95+
```
96+
Environment Variable (SPRING_APPLICATION_JSON)
97+
```json
98+
{
99+
"spring.datasource.hikari.data-source-properties.wrapperPlugins": "failover,efm2",
100+
"spring.datasource.hikari.data-source-properties.wrapperDialect": "aurora-pg"
101+
}
102+
```
103+
104+
### DriverManager
105+
When specifying a DataSource using DriverManager, parameters may be specified
106+
in the query section of the JDBC URL.
107+
108+
```
109+
url=jdbc:aws-wrapper:postgresql://<host_name>?[paramOne=valueOne[&paramTwo=valueTwo...]]
110+
```
111+
112+
For example:
113+
```
114+
url=jdbc:aws-wrapper:postgresql://db.example.com?database=example&tcpKeepAlive=true
115+
```
116+
117+
> [!NOTE]
118+
> When connecting to a MS SQL Server engine, standard URL parameter notation is
119+
> required. The driver will not parse parameters specified after semi-colons in
120+
> the traditional MSSQL URL format.
121+
122+
72123
## AWS Advanced JDBC Driver Parameters
73124
These parameters are applicable to any instance of the AWS JDBC Driver.
74125

0 commit comments

Comments
 (0)