From 8bc67a294066bac459b0026e21995ccda48d64ff Mon Sep 17 00:00:00 2001 From: Brian Shacklett Date: Tue, 22 Oct 2024 08:42:41 -0400 Subject: [PATCH] Add property spec examples --- .../UsingTheJdbcDriver.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md b/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md index 076a078af..5a74179b0 100644 --- a/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md +++ b/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md @@ -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://?[paramOne=valueOne[¶mTwo=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.