mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-03 16:24:31 +08:00
增加GoldenDB识别(pr#3886@Github)
This commit is contained in:
parent
58c193cb48
commit
161cb6fc19
@ -86,6 +86,9 @@ public class DialectFactory {
|
||||
return new PhoenixDialect(dbConfig);
|
||||
} else if (DriverNames.DRIVER_DM.equalsIgnoreCase(driverName)) {
|
||||
return new DmDialect(dbConfig);
|
||||
} else if (DriverNames.DRIVER_GOLDENDB.equalsIgnoreCase(driverName)) {
|
||||
// MySQL兼容
|
||||
return new MysqlDialect(dbConfig);
|
||||
}
|
||||
}
|
||||
// 无法识别可支持的数据库类型默认使用ANSI方言,可兼容大部分SQL语句
|
||||
|
@ -129,7 +129,9 @@ public class DriverIdentifier implements DriverNames{
|
||||
new StartsWithDriverMatcher(DRIVER_GREENPLUM, "jdbc:pivotal:greenplum:"),
|
||||
// 华为OpenGauss
|
||||
new StartsWithDriverMatcher(DRIVER_GAUSS, "jdbc:zenith:"),
|
||||
new StartsWithDriverMatcher(DRIVER_OPENGAUSS, "jdbc:opengauss:")
|
||||
new StartsWithDriverMatcher(DRIVER_OPENGAUSS, "jdbc:opengauss:"),
|
||||
// 中兴GoldenDB
|
||||
new StartsWithDriverMatcher(DRIVER_GOLDENDB, "jdbc:goldendb:")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -253,4 +253,8 @@ public interface DriverNames {
|
||||
*/
|
||||
String DRIVER_GREENPLUM = "com.pivotal.jdbc.GreenplumDriver";
|
||||
|
||||
/**
|
||||
* JDBC 驱动 GoldenDB
|
||||
*/
|
||||
String DRIVER_GOLDENDB = "com.goldendb.jdbc.Driver";
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ public class DriverUtilTest {
|
||||
map.put("jdbc:mariadb:", "org.mariadb.jdbc.Driver");
|
||||
map.put("jdbc:hive2:", "org.apache.hive.jdbc.HiveDriver");
|
||||
map.put("jdbc:hive:", "org.apache.hadoop.hive.jdbc.HiveDriver");
|
||||
map.put("jdbc:goldendb:", "com.goldendb.jdbc.Driver");
|
||||
|
||||
map.forEach((k, v) -> Assertions.assertEquals(v,
|
||||
DriverUtil.identifyDriver(k + RandomUtil.randomStringLower(2))));
|
||||
|
Loading…
x
Reference in New Issue
Block a user