yu199195 commented on a change in pull request #6366:
URL: https://github.com/apache/shardingsphere/pull/6366#discussion_r457001744
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/metadata/util/JdbcUtil.java
##########
@@ -36,7 +37,12 @@ public static String getSchema(final Connection connection,
final String databas
String result = null;
try {
if ("Oracle".equals(databaseType)) {
- return null;
+ DatabaseMetaData metaData = connection.getMetaData();
+ if (null != metaData) {
+ return metaData.getUserName() == null ? null :
metaData.getUserName().toUpperCase();
Review comment:
maybe :
if (null != metaData) {
return
Optional.ofNullable(metaData.getUserName()).map(String::toUpperCase).orElse(null);
} else {
return null;
}
----------------------------------------------------------------
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:
[email protected]