What is the best way to store MySQL login configuration settings in Java application.
I want to use MySQL connection in Java and become curious about
host/database/login/password
storage. My programm intend to be multithreading and write fixed login information to every class does not look nice. What is the best way to store auth data that can be used many times?
In PHP, for example, usually created mysqlinfo.php with global variables and included in every file. If some data change, all you need to do is modify mysqlinfo.php.
But what about Java? Should I user global variables or should I store login/password/etc. in private string of each class?