From 8b0f23f69efd17f55ca5bfb11bb75e3c59908889 Mon Sep 17 00:00:00 2001 From: Clearvive Date: Fri, 17 Nov 2023 11:35:37 +0800 Subject: [PATCH] [#676] feat(jdbc): Support jdbc operations in JDBC catalog. --- .../datastrato/gravitino/catalog/jdbc/config/JdbcConfig.java | 4 ++++ .../gravitino/catalog/jdbc/utils/DataSourceUtils.java | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/config/JdbcConfig.java b/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/config/JdbcConfig.java index 7f57bc27314..76da44980f3 100644 --- a/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/config/JdbcConfig.java +++ b/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/config/JdbcConfig.java @@ -72,4 +72,8 @@ public JdbcConfig(Map properties) { loadFromMap(properties, k -> true); assert null != getJdbcUrl(); } + + public Map getAllProperties() { + return getConfigsWithPrefix(""); + } } diff --git a/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/utils/DataSourceUtils.java b/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/utils/DataSourceUtils.java index 98ecf8284f7..cac1c080243 100644 --- a/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/utils/DataSourceUtils.java +++ b/catalogs/catalog-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/utils/DataSourceUtils.java @@ -57,8 +57,7 @@ private static DataSource createDBCPDataSource(JdbcConfig jdbcConfig) throws Exc private static Properties getProperties(JdbcConfig jdbcConfig) { Properties properties = new Properties(); - Map configsWithPrefix = jdbcConfig.getConfigsWithPrefix(""); - properties.putAll(configsWithPrefix); + properties.putAll(jdbcConfig.getAllProperties()); return properties; }