Skip to content

Commit

Permalink
添加神通数据库根据jdbcUrl获取DbType的支持 (#6134)
Browse files Browse the repository at this point in the history
* 添加神通数据库根据jdbcUrl获取DbType的支持

* 修改代码风格问题
  • Loading branch information
dsomehan authored Sep 25, 2024
1 parent f6a1d17 commit 7edc04c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import com.alibaba.druid.sql.dialect.oscar.ast.stmt.OscarSelectQueryBlock;
import com.alibaba.druid.sql.dialect.oscar.parser.OscarExprParser;
import com.alibaba.druid.sql.dialect.oscar.parser.OscarLexer;
import com.alibaba.druid.sql.dialect.oscar.visitor.OscarStatementParser;
import com.alibaba.druid.sql.dialect.phoenix.parser.PhoenixExprParser;
import com.alibaba.druid.sql.dialect.phoenix.parser.PhoenixLexer;
import com.alibaba.druid.sql.dialect.phoenix.parser.PhoenixStatementParser;
Expand Down Expand Up @@ -196,6 +197,8 @@ public static SQLStatementParser createSQLStatementParser(String sql, DbType dbT
return new ImpalaStatementParser(sql, features);
case doris:
return new DorisStatementParser(sql, features);
case oscar:
return new OscarStatementParser(sql, features);
default:
return new SQLStatementParser(sql, dbType, features);
}
Expand Down
2 changes: 2 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 @@ -664,6 +664,8 @@ public static DbType getDbTypeRaw(String rawUrl, String driverClassName) {
return DbType.gaussdb;
} else if (rawUrl.startsWith("jdbc:TAOS:") || rawUrl.startsWith("jdbc:TAOS-RS:")) {
return DbType.taosdata;
} else if (rawUrl.startsWith("jdbc:oscar:")) {
return DbType.oscar;
} else {
return null;
}
Expand Down

0 comments on commit 7edc04c

Please sign in to comment.