From b69ef0c881ba02e668726092436de2c7f8a57b79 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 20 Sep 2021 17:44:57 +0100 Subject: [PATCH] Upgrade to Oracle Database 21.3.0.0 Closes gh-28054 --- .../spring-boot-dependencies/build.gradle | 2 +- .../springframework/boot/jdbc/DataSourceBuilder.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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; + } } }