mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support gbase. for issue #1997
This commit is contained in:
@@ -68,6 +68,9 @@ public interface JdbcConstants {
|
||||
public static final String KINGBASE = "kingbase";
|
||||
public static final String KINGBASE_DRIVER = "com.kingbase.Driver";
|
||||
|
||||
public static final String GBASE = "gbase";
|
||||
public static final String GBASE_DRIVER = "com.gbase.jdbc.Driver";
|
||||
|
||||
public static final String OCEANBASE = "oceanbase";
|
||||
public static final String OCEANBASE_DRIVER = "com.mysql.jdbc.Driver";
|
||||
|
||||
|
||||
@@ -452,6 +452,8 @@ public final class JdbcUtils implements JdbcConstants {
|
||||
return JdbcConstants.DM_DRIVER;
|
||||
} else if (rawUrl.startsWith("jdbc:kingbase:")) {
|
||||
return JdbcConstants.KINGBASE_DRIVER;
|
||||
} else if (rawUrl.startsWith("jdbc:gbase:")) {
|
||||
return JdbcConstants.GBASE_DRIVER;
|
||||
} else if (rawUrl.startsWith("jdbc:hive:")) {
|
||||
return JdbcConstants.HIVE_DRIVER;
|
||||
} else if (rawUrl.startsWith("jdbc:hive2:")) {
|
||||
@@ -541,6 +543,8 @@ public final class JdbcUtils implements JdbcConstants {
|
||||
return JdbcConstants.DM;
|
||||
} else if (rawUrl.startsWith("jdbc:kingbase:")) {
|
||||
return JdbcConstants.KINGBASE;
|
||||
} else if (rawUrl.startsWith("jdbc:gbase:")) {
|
||||
return JdbcConstants.GBASE;
|
||||
} else if (rawUrl.startsWith("jdbc:log4jdbc:")) {
|
||||
return LOG4JDBC;
|
||||
} else if (rawUrl.startsWith("jdbc:hive:")) {
|
||||
|
||||
@@ -10,6 +10,14 @@ import junit.framework.TestCase;
|
||||
|
||||
public class JdbcUtilsTest2 extends TestCase {
|
||||
public void test_get_0() throws Exception {
|
||||
Assert.assertEquals(JdbcConstants.ORACLE_DRIVER, JdbcUtils.getDriverClassName("JDBC:oracle:"));
|
||||
assertEquals(JdbcConstants.ORACLE_DRIVER, JdbcUtils.getDriverClassName("JDBC:oracle:"));
|
||||
}
|
||||
|
||||
public void test_gbase() throws Exception {
|
||||
assertEquals(JdbcConstants.GBASE_DRIVER, JdbcUtils.getDriverClassName("jdbc:gbase:"));
|
||||
}
|
||||
|
||||
public void test_kingbase() throws Exception {
|
||||
assertEquals(JdbcConstants.KINGBASE_DRIVER, JdbcUtils.getDriverClassName("jdbc:kingbase:"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user