mirror of https://gitee.com/stylefeng/roses
【7.2.5】修改判断数据库类型,改为和枚举名称一致
parent
955361b686
commit
f564c53c95
|
@ -67,18 +67,16 @@ public enum DbTypeEnum {
|
|||
*/
|
||||
public static String getTypeByUrl(String url) {
|
||||
if (url == null) {
|
||||
return MYSQL.getUrlWords();
|
||||
return MYSQL.name();
|
||||
}
|
||||
if (url.contains(DbTypeEnum.ORACLE.getUrlWords())) {
|
||||
return ORACLE.getUrlWords();
|
||||
} else if (url.contains(DbTypeEnum.DM.getUrlWords())) {
|
||||
return DM.getUrlWords();
|
||||
} else if (url.contains(DbTypeEnum.MS_SQL.getUrlWords())) {
|
||||
return MS_SQL.getUrlWords();
|
||||
} else if (url.contains(DbTypeEnum.PG_SQL.getUrlWords())) {
|
||||
return PG_SQL.getUrlWords();
|
||||
|
||||
for (DbTypeEnum value : DbTypeEnum.values()) {
|
||||
if (url.contains(value.getUrlWords())) {
|
||||
return value.name();
|
||||
}
|
||||
}
|
||||
return MYSQL.getUrlWords();
|
||||
|
||||
return MYSQL.name();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue