Merge pull request #5332 from dataease/pr@dev@fixdatasource

fix: 校验数据库名称
This commit is contained in:
taojinlong 2023-05-26 11:58:39 +08:00 committed by GitHub
commit 06fef344ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -808,7 +808,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
break;
case oracle:
OracleConfiguration oracleConfiguration = new Gson().fromJson(datasource.getConfiguration(), OracleConfiguration.class);
if(!oracleConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$")){
if(!oracleConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$") && !oracleConfiguration.getConnectionType().equalsIgnoreCase("serviceName")){
throw new Exception("Invalid database name");
}
break;