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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35eec-2b81d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35eec-2b81d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?