Skip to content

Commit c7d419b

Browse files
committed
Merge pull request #43812 from vpavic
* gh-43812: Polish "Add support for AWS Advanced JDBC Wrapper" Add support for AWS Advanced JDBC Wrapper Closes gh-43812
2 parents 89cd525 + d90e622 commit c7d419b

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchDataSourceScriptDatabaseInitializerTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,8 +62,8 @@ void getSettingsWithPlatformDoesNotTouchDataSource() {
6262
}
6363

6464
@ParameterizedTest
65-
@EnumSource(value = DatabaseDriver.class, mode = Mode.EXCLUDE, names = { "CLICKHOUSE", "FIREBIRD", "INFORMIX",
66-
"JTDS", "PHOENIX", "REDSHIFT", "TERADATA", "TESTCONTAINERS", "UNKNOWN" })
65+
@EnumSource(value = DatabaseDriver.class, mode = Mode.EXCLUDE, names = { "AWS_JDBC_WRAPPER", "CLICKHOUSE",
66+
"FIREBIRD", "INFORMIX", "JTDS", "PHOENIX", "REDSHIFT", "TERADATA", "TESTCONTAINERS", "UNKNOWN" })
6767
void batchSchemaCanBeLocated(DatabaseDriver driver) throws SQLException {
6868
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
6969
BatchProperties properties = new BatchProperties();

spring-boot-project/spring-boot-parent/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ bom {
2525
]
2626
}
2727
}
28+
library("AWS Advanced JDBC Wrapper", "2.5.4") {
29+
group("software.amazon.jdbc") {
30+
modules = [
31+
"aws-advanced-jdbc-wrapper"
32+
]
33+
}
34+
}
2835
library("C3P0", "0.9.5.5") {
2936
group("com.mchange") {
3037
modules = [

spring-boot-project/spring-boot/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ dependencies {
100100
optional("org.yaml:snakeyaml")
101101
optional("org.jetbrains.kotlin:kotlin-reflect")
102102
optional("org.jetbrains.kotlin:kotlin-stdlib")
103+
optional("software.amazon.jdbc:aws-advanced-jdbc-wrapper") {
104+
exclude(group: "commons-logging", module: "commons-logging")
105+
}
103106

104107
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
105108
testImplementation("org.springframework:spring-core-test")

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java

+13
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ protected Collection<String> getUrlPrefixes() {
218218
return Arrays.asList("ch", "clickhouse");
219219
}
220220

221+
},
222+
223+
/**
224+
* AWS Advanced JDBC Wrapper.
225+
* @since 3.5.0
226+
*/
227+
AWS_WRAPPER(null, "software.amazon.jdbc.Driver") {
228+
229+
@Override
230+
protected Collection<String> getUrlPrefixes() {
231+
return Collections.singleton("aws-wrapper");
232+
}
233+
221234
};
222235

223236
private final String productName;

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ void databaseJdbcUrlLookups() {
121121
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:clickhouse://localhost:3306/sample"))
122122
.isEqualTo(DatabaseDriver.CLICKHOUSE);
123123
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:ch://localhost:3306/sample")).isEqualTo(DatabaseDriver.CLICKHOUSE);
124+
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:aws-wrapper:postgresql://127.0.0.1:5432/sample"))
125+
.isEqualTo(DatabaseDriver.AWS_WRAPPER);
124126
}
125127

126128
}

0 commit comments

Comments
 (0)