From d20d4a476d03fd877ea0ab62d956fa2c2b53e41f Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Thu, 9 Oct 2025 10:29:18 -0700 Subject: [PATCH] Update Java README files to reference JDBC connector --- java/pgjdbc/README.md | 9 +++++---- java/pgjdbc_hikaricp/README.md | 11 +++++++---- java/spring_boot/README.md | 11 ++++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/java/pgjdbc/README.md b/java/pgjdbc/README.md index 4b0d635d..2d38e23a 100644 --- a/java/pgjdbc/README.md +++ b/java/pgjdbc/README.md @@ -9,14 +9,14 @@ Aurora DSQL is a distributed SQL database service that provides high availabilit your PostgreSQL-compatible applications. `pgJDBC` is a popular PostgreSQL adapter for Java that allows you to interact with PostgreSQL databases using Java code. +This example uses the Aurora DSQL JDBC Connector to handle IAM authentication automatically. + ## About the code example The example demonstrates a flexible connection approach that works for both admin and non-admin users: -* When connecting as an **admin user**, the example uses the `public` schema and generates an admin authentication - token. -* When connecting as a **non-admin user**, the example uses a custom `myschema` schema and generates a standard - authentication token. +* When connecting as an **admin user**, the example uses the `public` schema. +* When connecting as a **non-admin user**, the example uses a custom `myschema` schema. The code automatically detects the user type and adjusts its behavior accordingly. @@ -114,6 +114,7 @@ The example contains comments explaining the code and the operations being perfo ## Additional resources * [Amazon Aurora DSQL Documentation](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/what-is-aurora-dsql.html) +* [Amazon Aurora DSQL JDBC Connector](https://github.com/awslabs/aurora-dsql-jdbc-connector) * [pgJDBC Documentation](https://jdbc.postgresql.org/documentation/) * [AWS SDK for Java Documentation](https://docs.aws.amazon.com/sdk-for-java/) diff --git a/java/pgjdbc_hikaricp/README.md b/java/pgjdbc_hikaricp/README.md index acdac6fa..774937db 100644 --- a/java/pgjdbc_hikaricp/README.md +++ b/java/pgjdbc_hikaricp/README.md @@ -9,13 +9,15 @@ This example demonstrates how to connect to Aurora DSQL using HikariCP connectio - **Monitoring**: Built-in metrics and leak detection - **Configuration**: tuning options to align with token refresh +This example uses the Aurora DSQL JDBC Connector to handle IAM authentication automatically. + ## About the code example -The example maintains the flexible connection approach as maintained in the standalone `pgJDBC` and Amazon Aurora DSQL example and continues to work for both admin and non-admin users. It introduces connection pooling via the HikariCP library and supports DSQL's dynamic IAM token generation and token refresh. +The example maintains the flexible connection approach as maintained in the standalone `pgJDBC` and Amazon Aurora DSQL example and continues to work for both admin and non-admin users. It introduces connection pooling via the HikariCP library. -### Token Refresh Architecture +### IAM Authentication -Aurora DSQL uses IAM-based authentication with short-lived tokens (15 minutes by default). This example implements a custom `CustomPGDataSource` that extends PostgreSQL's `PGSimpleDataSource` to automatically generate fresh tokens for each connection request. The token generation process uses AWS SDK's `DsqlUtilities` to create admin or non-admin tokens based on the user type. +Aurora DSQL uses IAM-based authentication with short-lived tokens (15 minutes by default). The Aurora DSQL JDBC Connector handles token generation and refresh automatically, creating admin or non-admin tokens based on the user type. ## ⚠️ Important @@ -138,8 +140,9 @@ These settings provide a production-ready configuration that handles Aurora DSQL ## Additional resources -- [HikariCP](https://github.com/brettwooldridge/HikariCP) - [Amazon Aurora DSQL Documentation](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/what-is-aurora-dsql.html) +- [Amazon Aurora DSQL JDBC Connector](https://github.com/awslabs/aurora-dsql-jdbc-connector) +- [HikariCP](https://github.com/brettwooldridge/HikariCP) - [pgJDBC Documentation](https://jdbc.postgresql.org/documentation/) - [AWS SDK for Java Documentation](https://docs.aws.amazon.com/sdk-for-java/) diff --git a/java/spring_boot/README.md b/java/spring_boot/README.md index a66a793b..71d7bfcc 100644 --- a/java/spring_boot/README.md +++ b/java/spring_boot/README.md @@ -8,14 +8,14 @@ shows you how to connect to an Aurora DSQL cluster and perform basic database op Aurora DSQL is a distributed SQL database service that provides high availability and scalability for your PostgreSQL-compatible applications. +This example uses the Aurora DSQL JDBC Connector to handle IAM authentication automatically. + ## About the code example The example demonstrates a flexible connection approach that works for both admin and non-admin users: -* When connecting as an **admin user**, the example uses the `public` schema and generates an admin authentication - token. -* When connecting as a **non-admin user**, the example uses a custom `myschema` schema and generates a standard - authentication token. +* When connecting as an **admin user**, the example uses the `public` schema. +* When connecting as a **non-admin user**, the example uses a custom `myschema` schema. The code automatically detects the user type and adjusts its behavior accordingly. @@ -120,10 +120,11 @@ mvn spring-boot:run ## Additional resources +- [Amazon Aurora DSQL Documentation](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/what-is-aurora-dsql.html) +- [Amazon Aurora DSQL JDBC Connector](https://github.com/awslabs/aurora-dsql-jdbc-connector) - [Spring Boot Documentation](https://spring.io/projects/spring-boot) - [Spring Data JDBC](https://spring.io/projects/spring-data-jdbc) - [HikariCP](https://github.com/brettwooldridge/HikariCP) -- [Amazon Aurora DSQL Documentation](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/what-is-aurora-dsql.html) - [AWS SDK for Java Documentation](https://docs.aws.amazon.com/sdk-for-java/) ---