spring boot 集成sharding-jdbc+ druid (shardingsphere)踩坑記錄

坑一:druid 要使用spring 版本而不是spring boot 版本spring

 

<!-- alibaba druid 因爲使用sharding-jdbc須要注意的是,此時druid不能用spring-boot-starter版本的,須要用正常的包:不然報找不到url -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.1.22</version>
        </dependency>

 

坑二:sharding-jdbc 使用spring boot版本而不是spring 版本apache

<dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
            <version>4.1.1</version>
        </dependency>
相關文章
相關標籤/搜索