Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2018/05/springboot-How-to-setup-datasources-dynamically-in-springboot #14

Open
utterances-bot opened this issue Aug 27, 2021 · 6 comments

Comments

@utterances-bot
Copy link

How to setup datasources dynamically in springboot

  1. Introduction This post would demo how to setup the datasources dynamically in the spring or springboot application.

https://www.bswen.com/2018/05/springboot-How-to-setup-datasources-dynamically-in-springboot.html

Copy link

wucun commented Aug 27, 2021

For 9.1 example, I'm really like to see an example how to read a bean property from ApplicationContext.xml and update it with a new value.

Btw, the sections after 9.1 were numbered incorrectly.

Copy link
Owner

bswen commented Aug 28, 2021

Thanks for your feedback, I would improve the blog content.

Copy link

wucun commented Aug 28, 2021

After playing the example in 9.1, finally I got what I want to do. Excellent! Thank you very much!

Copy link
Owner

bswen commented Aug 29, 2021

You are welcome, and I have written a post about spring boot and xml configuration example, here is the link: https://github.com/bswen/bswen-project/tree/master/spring-boot-applicationxml

Copy link

wucun commented Sep 3, 2021

Hello again, BSWen. How to make your 9.1 code to work for a bean? My datasource is defined in a bean. Especially I'm afraid that this line " @ConfigurationProperties(prefix="spring.datasource") " probably won't work anymore.

Copy link

wucun commented Sep 3, 2021

By the way mu project is an old spring project. It uses just beans, no Spring Boot so I don't see DataSourceConfig is ever triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants