You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/11/13 05:44:25 UTC

[GitHub] [incubator-shardingsphere] tristaZero commented on a change in pull request #3512: use jdbc api to fix oracle difference and fix other jdbc compatibility

tristaZero commented on a change in pull request #3512: use jdbc api to fix oracle difference and fix other jdbc compatibility
URL: https://github.com/apache/incubator-shardingsphere/pull/3512#discussion_r345577536
 
 

 ##########
 File path: sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/metadata/TableMetaDataLoader.java
 ##########
 @@ -103,60 +107,66 @@ public TableMetaData load(final String logicTableName, final ShardingRule shardi
             }
         });
     }
-    
-    private Collection<TableMetaData> load(final String dataSourceName, final String catalog, 
-                                           final String logicTableName, final Collection<DataNode> dataNodes, final String generateKeyColumnName, final EncryptRule encryptRule) throws SQLException {
+
+    private Collection<TableMetaData> load(final String dataSourceName, final String catalog,
+            final String logicTableName, final Collection<DataNode> dataNodes, final String generateKeyColumnName, final EncryptRule encryptRule) throws SQLException {
         Collection<TableMetaData> result = new LinkedList<>();
         try (Connection connection = connectionManager.getConnection(dataSourceName)) {
+            DatabaseMetaData metaData = connection.getMetaData();
+            String databaseName = metaData.getDatabaseProductName();
+            String schema = null;
+            if (databaseName != null && "oracle".equalsIgnoreCase(databaseName)) {
 
 Review comment:
   Catalog and schemaName are different, so we should store them togather in `DatabaseMetaData` ahead. Consequently, you can get catalog or schema from `DatabaseMetaData` when need. Add an interface named `getCatalog()` for `DataSourceMetaData` is necessary.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services