Merge pull request #3886 from zchazc/v5-dev

feat: 添加中兴数据库GoldenDB的url识别jdbc-driver逻辑
This commit is contained in:
Golden Looly 2025-03-07 10:39:23 +08:00 committed by GitHub
commit 0b072015da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -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;

View File

@ -116,4 +116,8 @@ public interface DriverNamePool {
* JDBC 驱动 OpenGauss
*/
String DRIVER_OPENGAUSS = "org.opengauss.Driver";
/**
* JDBC 驱动 GoldenDB
*/
String DRIVER_GOLDENDB = "com.goldendb.jdbc.Driver";
}

View File

@ -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,