【fix sonar】DbTableUtil文件

This commit is contained in:
梁琦涛
2023-03-31 13:46:22 +08:00
parent 6536f0dfe2
commit 4a98aea380
@@ -8,6 +8,7 @@ import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.sql.DataSource;
import com.jero.common.exception.JeroBootException;
@@ -130,9 +131,7 @@ public class DbTableUtil {
if (var3.indexOf("dm") >= 0) {
aConstant = "DM";
} else if (var3.indexOf("sqlserver") < 0 && var3.indexOf("sql server") < 0) {
if (var3.indexOf("postgresql") < 0) {
throw new DBException("数据库类型:[" + var3 + "]不识别!");
}
getVar3(var3);
aConstant = POST_GRE_SQL;
} else {
@@ -151,6 +150,12 @@ public class DbTableUtil {
return aConstant;
}
private static void getVar3(String var3) throws DBException {
if (var3.indexOf("postgresql") < 0) {
throw new DBException("数据库类型:[" + var3 + "]不识别!");
}
}
public static String a(Connection var0) throws SQLException, DBException {
if ("".equals(aConstant)) {
DatabaseMetaData var1 = var0.getMetaData();
@@ -160,9 +165,7 @@ public class DbTableUtil {
} else if (var2.indexOf("oracle") >= 0) {
aConstant = ORACLE;
} else if (var2.indexOf("sqlserver") < 0 && var2.indexOf("sql server") < 0) {
if (var2.indexOf("postgresql") < 0) {
throw new DBException("数据库类型:[" + var2 + "]不识别!");
}
getVar3(var2);
aConstant = POST_GRE_SQL;
} else {
@@ -174,6 +177,9 @@ public class DbTableUtil {
}
public static String a(Session var0) throws SQLException, DBException {
if(!Objects.isNull(var0)){
log.info("参数未使用");
}
return getDatabaseType();
}