Update SQLConfig.java
This commit is contained in:
parent
74a7717dd7
commit
9c73e745c7
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user