0%

springboot

命令小记

  • 另一种部署jar方式:

      java -jar -Dserver.port=8090 wxsell.jar
    
  • maven打包

      mvn clean package -Dmaven.test.skip=true
    

springboot多数据源

  • 第二数据源
      yml配置文件中:
    
          custom:
            datasource:
              names: ds1
              ds1:
                driver-class-name: com.mysql.jdbc.Driver
                url: jdbc:mysql://121.196.221.4:3306:test
                username: 123
                password: 123    
            
      service impl中相应的要使用第二数据源的方法中:
    
          @TargetDataSource("ds1")
          public void insert() {
      
          }