This content has been marked as final. Show 3 replies
I am looking for a system wide configuration. How can I load data from a database using Properties?
You don't - you would use JDBC to connect to the database when your app starts and select the properties and values from a database table. Then you could iterate the result set that is returned and load the values into a Properties instance if you like.
Of course the chicken and egg problem is that your app need a minmal set of properties to know how to connect to the database. Those properties could be passed on the command line to make that part 'system-wide'.
The whole idea begs the question of whether you really want your application dependent on the availability of the database in order to even run. If the app needs that database for proper operation of other functionality then that isn't a problem.
Again, everyone would be better able to help if you gave an actual example of the types of configuration properties you are talking about.