Skip to content

Commit

Permalink
国产数据库Goldendb的jdbc url支持
Browse files Browse the repository at this point in the history
  • Loading branch information
theWangs authored and lizongbo committed Apr 7, 2024
1 parent bb6077d commit 27a5a26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/com/alibaba/druid/DbType.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public enum DbType {

starrocks(1L << 43),

goldendb(1L << 44),

ingres(0),
cloudscape(0),
timesten(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@ protected void initCheck() throws SQLException {
|| JdbcUtils.MYSQL_DRIVER.equals(this.driverClass)
|| JdbcUtils.MYSQL_DRIVER_6.equals(this.driverClass)
|| JdbcUtils.MYSQL_DRIVER_603.equals(this.driverClass)
|| JdbcUtils.GOLDENDB_DRIVER.equals(this.driverClass)
) {
isMySql = true;
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/com/alibaba/druid/util/JdbcConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,6 @@ public interface JdbcConstants {

String TAOS_DATA = "com.taosdata.jdbc.TSDBDriver";
String TAOS_DATA_RS = "com.taosdata.jdbc.rs.RestfulDriver";

String GOLDENDB_DRIVER = "com.goldendb.jdbc.Driver";
}
3 changes: 3 additions & 0 deletions core/src/main/java/com/alibaba/druid/util/JdbcUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ public static DbType getDbTypeRaw(String rawUrl, String driverClassName) {
} else if (rawUrl.startsWith("jdbc:mysql:") || rawUrl.startsWith("jdbc:cobar:")
|| rawUrl.startsWith("jdbc:log4jdbc:mysql:")) {
return DbType.mysql;
} else if (rawUrl.startsWith("jdbc:goldendb:")) {
return DbType.mysql;
} else if (rawUrl.startsWith("jdbc:mariadb:")) {
return DbType.mariadb;
} else if (rawUrl.startsWith("jdbc:tidb:")) {
Expand Down Expand Up @@ -976,6 +978,7 @@ public static boolean isMysqlDbType(DbType dbType) {
case mariadb:
case tidb:
case h2:
case goldendb:
return true;
default:
return false;
Expand Down

0 comments on commit 27a5a26

Please sign in to comment.