mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-04 23:39:32 +08:00
feat: 添加中兴数据库GoldenDB的url识别jdbc-driver逻辑
This commit is contained in:
parent
2046809264
commit
c94e3baa28
@ -45,7 +45,8 @@ public class DialectFactory implements DriverNamePool {
|
||||
*/
|
||||
private static Dialect internalNewDialect(String driverName) {
|
||||
if (StrUtil.isNotBlank(driverName)) {
|
||||
if (DRIVER_MYSQL.equalsIgnoreCase(driverName) || DRIVER_MYSQL_V6.equalsIgnoreCase(driverName)) {
|
||||
if (DRIVER_MYSQL.equalsIgnoreCase(driverName) || DRIVER_MYSQL_V6.equalsIgnoreCase(driverName)
|
||||
|| DRIVER_GOLDENDB.equalsIgnoreCase(driverName)) {
|
||||
return new MysqlDialect();
|
||||
} else if (DRIVER_ORACLE.equalsIgnoreCase(driverName) || DRIVER_ORACLE_OLD.equalsIgnoreCase(driverName)) {
|
||||
return new OracleDialect();
|
||||
@ -164,6 +165,9 @@ public class DialectFactory implements DriverNamePool {
|
||||
} else if (nameContainsProductInfo.contains("opengauss")) {
|
||||
// OpenGauss
|
||||
driver = DRIVER_OPENGAUSS;
|
||||
} else if (nameContainsProductInfo.contains("goldendb")) {
|
||||
// GoldenDB
|
||||
driver = DRIVER_GOLDENDB;
|
||||
}
|
||||
|
||||
return driver;
|
||||
|
@ -116,4 +116,8 @@ public interface DriverNamePool {
|
||||
* JDBC 驱动 OpenGauss
|
||||
*/
|
||||
String DRIVER_OPENGAUSS = "org.opengauss.Driver";
|
||||
/**
|
||||
* JDBC 驱动 GoldenDB
|
||||
*/
|
||||
String DRIVER_GOLDENDB = "com.goldendb.jdbc.Driver";
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ public class DialectFactoryTest {
|
||||
map.put("oscar",DRIVER_OSCAR);
|
||||
map.put("sybase",DRIVER_SYBASE);
|
||||
map.put("mariadb",DRIVER_MARIADB);
|
||||
map.put("goldendb",DRIVER_GOLDENDB);
|
||||
|
||||
|
||||
map.forEach((k,v) -> assertEquals(v,
|
||||
|
Loading…
Reference in New Issue
Block a user