Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.1k views
in Technique[技术] by (71.8m points)

SpringBoot 怎么实现数据源的动态添加修改

问题描述

项目需求:要求把数据库的连接信息写入系统参数表里边,后面可以在某个页面上进行编辑修改,内部代码变量(数据源2的引用)也可以生效,之前只有过手动配置@Bean的经验,像这样页面上修改后能重新加载数据库连接资源对象没有经验,有经验的朋友可以提供一下思路,感谢!!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

又看到了这种需求了 - -
AbstractRoutingDataSource可以搞定


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...