Skip to content

Commit

Permalink
修复OceanBase validateQuery问题
Browse files Browse the repository at this point in the history
  • Loading branch information
PeppaO authored and wenshao committed Oct 20, 2022
1 parent 118c21c commit 569f4a6
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
import java.sql.Statement;

public class OceanBaseValidConnectionChecker extends ValidConnectionCheckerAdapter implements ValidConnectionChecker {
private String oracleModeValidateQuery = "SELECT 'x' FROM DUAL";
private String mysqlModeValidateQuery = "SELECT 'x'";
private String commonValidateQuery = "SELECT 'x' FROM DUAL";
private DbType dbType;

public OceanBaseValidConnectionChecker() {
Expand All @@ -47,11 +46,7 @@ public boolean isValidConnection(final Connection c,
}
if (validateQuery == null || validateQuery.isEmpty()) {
if (dbType != null) {
if (dbType == DbType.oceanbase) {
validateQuery = mysqlModeValidateQuery;
} else {
validateQuery = oracleModeValidateQuery;
}
validateQuery = commonValidateQuery;
}
}

Expand Down

0 comments on commit 569f4a6

Please sign in to comment.