当前位置: 首页 > news >正文

Nacos-2.2.2源码修改集成高斯数据库GaussDB,postresql

一 ,下载代码

Release 2.2.2 (Apr 11, 2023) · alibaba/nacos · GitHub

二, 执行打包

mvn -Prelease-nacos -Dmaven.test.skip=true -Drat.skip=true clean install -U

mvn -Prelease-nacos ‘-Dmaven.test.skip=true’ ‘-Drat.skip=true’ clean install -U
注意:请不要把源码放在中文路径下,会报各种意想不到的错误。

打包的结果在distribution中

三,添加驱动jar包

 1,根目录下:/pom.xml

postgresql的 

<postgresql.version>42.3.3</postgresql.version><dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId><version>${postgresql.version}</version>
</dependency>

高斯的

<opengauss.version>3.0.0</opengauss.version><dependency><groupId>org.opengauss</groupId><artifactId>opengauss-jdbc</artifactId><version>${opengauss.version}</version>
</dependency>

2,config项目下的 /pom.xml

postgresql的

<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId>
</dependency>

高斯的

<dependency><groupId>org.opengauss</groupId><artifactId>opengauss-jdbc</artifactId>
</dependency>

3,naming项目下的

 postgresql的

<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId>
</dependency>

高斯的

 <dependency><groupId>org.opengauss</groupId><artifactId>opengauss-jdbc</artifactId></dependency>

四,添加PostgreSQL驱动代码

高斯的驱动代码和PostgreSQL是一模一样的

① PropertiesConstant.java

    public static final String POSTGRESQL = "postgresql";

② PropertyUtil.java#loadSetting

String platform = DatasourcePlatformUtil.getDatasourcePlatform("");/*boolean useExternalStorage = !PropertiesConstant.EMPTY_DATASOURCE_PLATFORM.equalsIgnoreCase(platform)&& !PropertiesConstant.DERBY.equalsIgnoreCase(platform);setUseExternalDB(useExternalStorage);*/setUseExternalDB(PropertiesConstant.MYSQL.equalsIgnoreCase(platform) || PropertiesConstant.POSTGRESQL.equalsIgnoreCase(platform));

③ ExternalDataSourceProperties.java

    private static final String JDBC_DRIVER_NAME_POSTGRESQL = "org.postgresql.Driver";

④ StartingApplicationListener.java

    private static final String DATABASE_POSTGRESQL = "postgresql";

五, 配置文件

数据库链接自己配置

http://www.lryc.cn/news/220682.html

相关文章:

  • Linux 内核中根据文件inode号获取其对应的struct inode
  • Pycharm-community-2021版安装和配置
  • 飞书开发学习笔记(一)-应用创建和测试
  • 【Mybatis小白从0到90%精讲】12:Mybatis删除 delete, 推荐使用主键删除!
  • RocketMQ批量发送消息❓
  • 一键同步chromedriver版本
  • Zephyr-7B-β :类GPT的高速推理LLM
  • 【笔试题】位运算
  • RT-Thread 10. 使用keil4编译GD32F450
  • Vue 跨域的两种解决方式
  • 【windows Docker 安装mysql:只需3条命令】
  • 【软件逆向】如何逆向Unity3D+il2cpp开发的安卓app【IDA Pro+il2CppDumper+DnSpy+AndroidKiller】
  • vue3ref和reactive
  • [架构之路-244]:目标系统 - 设计方法 - 软件工程 - 软件开发方法与软件开发模型
  • Matter 系列 #10|Matter 的证书吊销机制
  • mybatis动态表名
  • 高校为什么需要大数据挖掘平台?
  • @Value的使用
  • 用 Wireshark 在 Firefox 或 Google Chrome 上使用 SSLKEYLOGFILE 环境变量解密 SSL 流量
  • 京东大数据:2023年Q3美妆行业数据分析报告
  • [题] 改革春风吹满地 #图论 #多边形面积
  • FPGA时序分析与约束(2)——时序电路时序
  • 明御安全网关任意文件上传漏洞复现
  • JVM虚拟机:如何查看自己的JVM默认的垃圾回收器
  • 目标检测YOLO系列从入门到精通技术详解100篇-【目标检测】机器视觉
  • 设计模式——建造者模式
  • Go语言用Colly库编写的图像爬虫程序
  • 14.2 并发与竞争实验
  • 【MediaTek】T750实现Host 网络和Guest 网络隔离以及各个连接终端间隔离功能
  • 数字滤波器之高通滤波器设计