7

ShardingSphere 中 sharding-jdbc + Oracle 启动异常

 2 years ago
source link: https://www.oschina.net/question/3251146_2325088
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ShardingSphere 中 sharding-jdbc + Oracle 启动异常

烛✟孩 发布于 昨天 15:10

spring boot 2.6.2
shardingsphere 4.1.1

shardingsphere 中的 JdbcUtil

当数据库为 Oracle 时,getSchema 返回 null,导致查询 all_objects 时结果好多都不是正常的数据表,导致【ORA-00942: 表或视图不存在】,这是什么情况?

public class JdbcUtil {
    
    /**
     * Get schema.
     *
     * @param connection connection
     * @param databaseType database type
     * @return schema
     */
public static String getSchema(final Connection connection, final String databaseType) {
        String result = null;
        try {
            if ("Oracle".equals(databaseType)) {
                return null;
            }
            result = connection.getSchema();
        } catch (final SQLException ignore) {
        }
        return result;
    }
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK