This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new cfb4dac77ce fix 
ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchema() when using 
ojdbc6; (#21980)
cfb4dac77ce is described below

commit cfb4dac77ce2ca595b901d7e2ce7c94113311d83
Author: xiaoLi <[email protected]>
AuthorDate: Mon Nov 7 22:35:29 2022 +0800

    fix ShardingSphereException:oracle.jdbc.driver.T4CConnection.getSchema() 
when using ojdbc6; (#21980)
---
 .../database/schema/loader/dialect/OracleSchemaMetaDataLoader.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/dialect/OracleSchemaMetaDataLoader.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/dialect/OracleSchemaMetaDataLoader.java
index 03f8c344ccb..03bc4ebbae4 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/dialect/OracleSchemaMetaDataLoader.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/dialect/OracleSchemaMetaDataLoader.java
@@ -19,6 +19,7 @@ package 
org.apache.shardingsphere.infra.metadata.database.schema.loader.dialect;
 
 import com.google.common.collect.Lists;
 import org.apache.shardingsphere.infra.database.type.DatabaseTypeFactory;
+import 
org.apache.shardingsphere.infra.metadata.database.schema.loader.adapter.MetaDataLoaderConnectionAdapter;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.loader.model.ColumnMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.loader.model.IndexMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.loader.model.SchemaMetaData;
@@ -74,7 +75,7 @@ public final class OracleSchemaMetaDataLoader implements 
DialectSchemaMetaDataLo
     public Collection<SchemaMetaData> load(final DataSource dataSource, final 
Collection<String> tables, final String defaultSchemaName) throws SQLException {
         Map<String, Collection<ColumnMetaData>> columnMetaDataMap = new 
HashMap<>(tables.size(), 1);
         Map<String, Collection<IndexMetaData>> indexMetaDataMap = new 
HashMap<>(tables.size(), 1);
-        try (Connection connection = dataSource.getConnection()) {
+        try (Connection connection = new 
MetaDataLoaderConnectionAdapter(DatabaseTypeFactory.getInstance("Oracle"), 
dataSource.getConnection())) {
             for (List<String> each : Lists.partition(new ArrayList<>(tables), 
MAX_EXPRESSION_SIZE)) {
                 columnMetaDataMap.putAll(loadColumnMetaDataMap(connection, 
each));
                 indexMetaDataMap.putAll(loadIndexMetaData(connection, each));

Reply via email to