I have several java projects which use hibernate to persist to a DB. At the moment, I have hibernate.properties file embedded in one persistence project.
However, I would like to be able to specify to have two different files one for prod and one for dev.
What is the best practise….should I embed the config files into my jars? How do I build my projects to use the correct properties with Maven?
Thanks.
You probably want to have the key database properties (name/user/password) set as properties at runtime either from a properties file that’s itself specified as a property (the URL of the file can be specified as a property) or a set of properties (a property for each of name/user/password). The former is probably the preferred approach.
You could ask your system/database administrator type what they like 🙂