Update SQLConfig.java

This commit is contained in:
TommyLemon 2022-10-17 21:30:45 +08:00 committed by GitHub
parent 74a7717dd7
commit 9c73e745c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,10 +44,10 @@ public interface SQLConfig {
boolean isDameng(); boolean isDameng();
boolean isClickHouse(); boolean isClickHouse();
boolean isHive(); boolean isHive();
boolean isTDengine(); boolean isTDengine();
//暂时只兼容以上几种 //暂时只兼容以上几种
// boolean isSQL(); // boolean isSQL();
// boolean isTSQL(); // boolean isTSQL();
// boolean isPLSQL(); // boolean isPLSQL();
@ -67,26 +67,26 @@ public interface SQLConfig {
*/ */
String getDBVersion(); String getDBVersion();
@NotNull @NotNull
default int[] getDBVersionNums() { default int[] getDBVersionNums() {
String dbVersion = StringUtil.getNoBlankString(getDBVersion()); String dbVersion = StringUtil.getNoBlankString(getDBVersion());
if (dbVersion.isEmpty()) { if (dbVersion.isEmpty()) {
return new int[]{0}; return new int[]{0};
} }
int index = dbVersion.indexOf("-"); int index = dbVersion.indexOf("-");
if (index > 0) { if (index > 0) {
dbVersion = dbVersion.substring(0, index); dbVersion = dbVersion.substring(0, index);
} }
String[] ss = dbVersion.split("[.]"); String[] ss = dbVersion.split("[.]");
int[] nums = new int[Math.max(1, ss.length)]; int[] nums = new int[Math.max(1, ss.length)];
for (int i = 0; i < ss.length; i++) { for (int i = 0; i < ss.length; i++) {
nums[i] = Integer.valueOf(ss[i]); nums[i] = Integer.valueOf(ss[i]);
} }
return nums; return nums;
} }
/**获取数据库地址 /**获取数据库地址
* @return * @return