Skip to content

Commit

Permalink
[INLONG-11648][Manager] Oceanbase adds URL verification (#11650)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweng11 authored Jan 6, 2025
1 parent 3662bcd commit 513b894
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.inlong.manager.common.util.UrlVerificationUtils;
import org.apache.inlong.manager.pojo.sink.oceanbase.OceanBaseColumnInfo;
import org.apache.inlong.manager.pojo.sink.oceanbase.OceanBaseTableInfo;
import org.apache.inlong.manager.pojo.util.MySQLSensitiveUrlUtils;

import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -75,6 +76,8 @@ private static Connection establishDatabaseConnection(String url, String user, S
throw new Exception("OceanusBase URL is invalid, it should start with jdbc:oceanbase");
}
try {
UrlVerificationUtils.extractHostAndValidatePortFromJdbcUrl(url, OCEANBASE_JDBC_PREFIX);
url = MySQLSensitiveUrlUtils.filterSensitive(url);
Class.forName(OCEANBASE_DRIVER_CLASS);
conn = DriverManager.getConnection(url, user, password);
} catch (Exception e) {
Expand Down

0 comments on commit 513b894

Please sign in to comment.