How does java web automatically select databases?

how does java web automatically select databases? For example, automatically connect to localhost:3306, in the test environment and connect to the domain name in the formal environment: 3306?

Mar.07,2021

does it mean that you want to configure startup items in multiple environments? If you use Spring, spring profile will learn about it, and you can also select startup items through Maven. There are many ways to solve your problem.


are your databases and programs deployed together? If it is, in fact, it is possible to directly use localhost, and it all points to your own local machine. But 127.0.0.1 is better

Menu