spring boot 集成sharding-jdbc+ druid (shardingsphere)踩坑记录


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

 

        <!-- 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 版本

        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
            <version>4.1.1</version>
        </dependency>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM