diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 3b7bf62ca4..53d1b8ffcc 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1313,7 +1313,7 @@ bom { ] } } - library("Oracle Database", "21.1.0.0") { + library("Oracle Database", "21.3.0.0") { group("com.oracle.database.jdbc") { imports = [ "ojdbc-bom" diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java index 0e3409dd89..c2ae248fc7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java @@ -646,7 +646,17 @@ public final class DataSourceBuilder { add(DataSourceProperty.DRIVER_CLASS_NAME, PoolDataSource::getConnectionFactoryClassName, PoolDataSource::setConnectionFactoryClassName); add(DataSourceProperty.USERNAME, PoolDataSource::getUser, PoolDataSource::setUser); - add(DataSourceProperty.PASSWORD, PoolDataSource::getPassword, PoolDataSource::setPassword); + add(DataSourceProperty.PASSWORD, passwordGetter(), PoolDataSource::setPassword); + } + + @SuppressWarnings("deprecation") + static Getter passwordGetter() { + try { + return (dataSource) -> dataSource.getPassword(); + } + catch (NoSuchMethodError ex) { + return null; + } } }