fix: checkstyle

This commit is contained in:
vran 2022-05-07 09:59:59 +08:00
parent 799bb67a1a
commit cec55f25a7
1 changed files with 5 additions and 5 deletions

View File

@ -71,17 +71,17 @@ public class CustomDatabaseConnectionFactory implements DatabaseConnectionFactor
throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常:" + e.getMessage());
}
String urlPattern = type.getUrlPattern();
String jdbcUrl = urlPattern.replace("{{jdbc.protocol}}", type.getJdbcProtocol())
.replace("{{db.url}}", context.getUrl())
.replace("{{db.name}}", context.getDatabaseName())
.replace("{{db.schema}}", context.getSchemaName());
Properties info = new Properties();
info.put("user", context.getUsername());
info.put("password", context.getPassword());
if (context.getProperties() != null && !context.getProperties().isEmpty()) {
info.putAll(context.getProperties());
}
String urlPattern = type.getUrlPattern();
String jdbcUrl = urlPattern.replace("{{jdbc.protocol}}", type.getJdbcProtocol())
.replace("{{db.url}}", context.getUrl())
.replace("{{db.name}}", context.getDatabaseName())
.replace("{{db.schema}}", context.getSchemaName());
return driver.connect(jdbcUrl, info);
}