Skip to content

Commit

Permalink
Fixed: Modify the code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xxsc0529 committed Jul 22, 2024
1 parent 3ca4bd7 commit 0006d51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
public class OceanBaseDataNodeDTO {

private static final Logger LOGGER = LoggerFactory.getLogger(OceanBaseDataNodeDTO.class);
private static final String OceanBase_JDBC_PREFIX = "jdbc:oceanbase://";
private static final String OCEANBASE_JDBC_PREFIX = "jdbc:oceanbase://";

@ApiModelProperty("URL of backup DB server")
private String backupUrl;
Expand Down Expand Up @@ -77,8 +77,8 @@ public static OceanBaseDataNodeDTO getFromJson(@NotNull String extParams) {
*/
public static String convertToJdbcurl(String url) {
String jdbcUrl = url;
if (StringUtils.isNotBlank(jdbcUrl) && !jdbcUrl.startsWith(OceanBase_JDBC_PREFIX)) {
jdbcUrl = OceanBase_JDBC_PREFIX + jdbcUrl;
if (StringUtils.isNotBlank(jdbcUrl) && !jdbcUrl.startsWith(OCEANBASE_JDBC_PREFIX)) {
jdbcUrl = OCEANBASE_JDBC_PREFIX + jdbcUrl;
}
return jdbcUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
*/
public class OceanBaseJdbcUtils {

private static final String OceanBase_JDBC_PREFIX = "jdbc:mysql://";
private static final String OceanBase_DRIVER_CLASS = "com.oceanbase.jdbc.Driver";
private static final String OCEANBASE_JDBC_PREFIX = "jdbc:mysql://";
private static final String OCEANBASE_DRIVER_CLASS = "com.oceanbase.jdbc.Driver";
private static final Logger LOGGER = LoggerFactory.getLogger(OceanBaseJdbcUtils.class);

/**
Expand All @@ -52,7 +52,7 @@ public class OceanBaseJdbcUtils {
* @throws Exception on get connection error
*/
public static Connection getConnection(String url, String user, String password) throws Exception {
UrlVerificationUtils.extractHostAndValidatePortFromJdbcUrl(url, OceanBase_JDBC_PREFIX);
UrlVerificationUtils.extractHostAndValidatePortFromJdbcUrl(url, OCEANBASE_JDBC_PREFIX);
Connection conn = establishDatabaseConnection(url, user, password);
return conn;
}
Expand All @@ -69,7 +69,7 @@ public static Connection getConnection(String url, String user, String password)
private static Connection establishDatabaseConnection(String url, String user, String password) throws Exception {
Connection conn;
try {
Class.forName(OceanBase_DRIVER_CLASS);
Class.forName(OCEANBASE_DRIVER_CLASS);
conn = DriverManager.getConnection(url, user, password);

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

Potential server-side request forgery due to a
user-provided value
.
} catch (Exception e) {
String errorMsg =
Expand Down

0 comments on commit 0006d51

Please sign in to comment.