db2数据库jdbc驱动,springboot配置连接db2

在这里插入图片描述
db2数据库jdbc驱动,springboot配置连接db2_第1张图片

1.jar包目录下cmd进入命令窗口,添加到maven仓库

mvn install:install-file "-DgroupId=com.ibm.db2" "-DartifactId=db2jcc_license_cu" "-Dversion=11.1.4.4" "-Dpackaging=jar" "-Dfile=D:\BaiduNetdiskDownload\db2\db2server\db2jcc\db2jcc_license_cu.jar"
mvn install:install-file "-DgroupId=com.ibm.db2" "-DartifactId=db2jcc4" "-Dversion=11.1.4.4" "-Dpackaging=jar" "-Dfile=D:\BaiduNetdiskDownload\db2\db2server\db2jcc4\db2jcc4.jar"

2.添加maven依赖

        
            com.ibm.db2
            db2jcc4
            11.1.4.4
        
       
            com.ibm.db2
            db2jcc_license_cu
            11.1.4.4
        

3.yml文件中配置

server:
  port: 1688
spring:
  application:
    name: rh-db2
  datasource:
    driver-class-name: com.ibm.db2.jcc.DB2Driver
    url: jdbc:db2://11.33.98.168:50000/TRADECTR
    username: root
    password: root

jar包

链接:https://pan.baidu.com/s/1HRwN6gR_7kU9EeS2IN2vZw 
提取码:31s7

你可能感兴趣的:(spring,boot,数据库,java,db,intellij-idea)