Parcourir la source

添加达梦数据库支持

Devli il y a 1 an
Parent
commit
f28e6f8a7a

BIN
report-core/lib/dm8/DmJdbcDriver18-8.1.3.140.jar


+ 15 - 0
report-core/src/main/assembly/assembly.xml

@@ -31,6 +31,21 @@
 			<outputDirectory>lib</outputDirectory>
 			<fileMode>0755</fileMode>
 		</fileSet>
+		<fileSet>
+			<directory>lib/dm8</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
+		<fileSet>
+			<directory>lib/opengauss</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
+		<fileSet>
+			<directory>lib/kingbase</directory>
+			<outputDirectory>lib</outputDirectory>
+			<fileMode>0755</fileMode>
+		</fileSet>
 		<fileSet>
 			<directory>src/main/assembly/bin</directory>
 			<outputDirectory>bin</outputDirectory>

+ 6 - 0
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/datasource/service/impl/DataSourceServiceImpl.java

@@ -101,6 +101,9 @@ public class DataSourceServiceImpl implements DataSourceService {
             case JdbcConstants.SQL_SERVER:
             case JdbcConstants.JDBC:
             case JdbcConstants.POSTGRESQL:
+            case JdbcConstants.DAMENG:
+            case JdbcConstants.OPENGAUSS:
+            case JdbcConstants.KINGBASE:
                 testRelationalDb(dto);
                 break;
             case JdbcConstants.HTTP:
@@ -126,6 +129,9 @@ public class DataSourceServiceImpl implements DataSourceService {
             case JdbcConstants.SQL_SERVER:
             case JdbcConstants.JDBC:
             case JdbcConstants.POSTGRESQL:
+            case JdbcConstants.DAMENG:
+            case JdbcConstants.OPENGAUSS:
+            case JdbcConstants.KINGBASE:
                 return executeRelationalDb(dto);
             case JdbcConstants.HTTP:
                 return executeHttp(dto);

+ 3 - 2
report-core/src/main/java/com/anjiplus/template/gaea/business/util/JdbcConstants.java

@@ -15,7 +15,9 @@ public class JdbcConstants {
    public final static String SQL_SERVER = "mssqlserver";
    public final static String JDBC = "jdbc";
    public final static String POSTGRESQL = "postgresql";
-
+   public final static String DAMENG = "dameng";
+   public final static String OPENGAUSS = "openGauss";
+   public final static String KINGBASE = "Kingbase";
 
    public final static String JTDS = "jtds";
    public final static String MOCK = "mock";
@@ -44,7 +46,6 @@ public class JdbcConstants {
    public final static String H2_DRIVER = "org.h2.Driver";
    public final static String DM = "dm";
    public final static String DM_DRIVER = "dm.jdbc.driver.DmDriver";
-   public final static String KINGBASE = "kingbase";
    public final static String KINGBASE_DRIVER = "com.kingbase.Driver";
    public final static String GBASE = "gbase";
    public final static String GBASE_DRIVER = "com.gbase.jdbc.Driver";

+ 18 - 1
report-core/src/main/resources/db/migration/V1.4.2__update.sql

@@ -1,3 +1,20 @@
 INSERT INTO gaea_dict_item
 (dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
-VALUES('SOURCE_TYPE', 'postgresql', 'postgresql', '[{"label":"driverName","value":"org.postgresql.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:postgresql://127.0.0.1:5432/pgdb","labelValue":"连接串"},{"label":"username","value":"root","labelValue":"用户名"},{"label":"password","value":"root","labelValue":"密码"}]', 1, 'zh', NULL, 2, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+VALUES('SOURCE_TYPE', 'postgresql', 'postgresql', '[{"label":"driverName","value":"org.postgresql.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:postgresql://127.0.0.1:5432/pgdb","labelValue":"连接串"},{"label":"username","value":"root","labelValue":"用户名"},{"label":"password","value":"root","labelValue":"密码"}]', 1, 'zh', NULL, 4, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', '达梦', 'dameng', '[{"label":"driverName","value":"dm.jdbc.driver.DmDriver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:dm://127.0.0.1:5236","labelValue":"连接串"},{"label":"username","value":"SYSDBA","labelValue":"用户名"},{"label":"password","value":"SYSDBA","labelValue":"密码"}]', 1, 'zh', NULL, 11, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', 'openGauss', 'openGauss', '[{"label":"driverName","value":"org.opengauss.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:opengauss://127.0.0.1:5432/postgres","labelValue":"连接串"},{"label":"username","value":"gaussdb","labelValue":"用户名"},{"label":"password","value":"gaussdb","labelValue":"密码"}]', 1, 'zh', NULL, 12, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+INSERT INTO gaea_dict_item
+(dict_code, item_name, item_value, item_extend, enabled, locale, remark, sort, create_by, create_time, update_by, update_time, version)
+VALUES('SOURCE_TYPE', '人大金仓', 'Kingbase', '[{"label":"driverName","value":"com.kingbase8.Driver","labelValue":"驱动类"},{"label":"jdbcUrl","value":"jdbc:kingbase8://127.0.0.1:54321/test","labelValue":"连接串"},{"label":"username","value":"SYSTEM","labelValue":"用户名"},{"label":"password","value":"123456","labelValue":"密码"}]', 1, 'zh', NULL, 13, 'admin', '2021-03-23 10:54:08', 'admin', '2021-03-23 10:54:08', 1);
+
+UPDATE gaea_dict_item SET sort=31 WHERE dict_code ='SOURCE_TYPE' and item_name='elasticsearch_sql';
+UPDATE gaea_dict_item SET sort=32 WHERE dict_code ='SOURCE_TYPE' and item_name='kudu impala';
+UPDATE gaea_dict_item SET sort=33 WHERE dict_code ='SOURCE_TYPE' and item_name='jdbc';
+UPDATE gaea_dict_item SET sort=34 WHERE dict_code ='SOURCE_TYPE' and item_name='http';