-
Notifications
You must be signed in to change notification settings - Fork 88
guide spring configuration
The configuration for spring and Hibernate is already provided by devonfw in our sample application and the application template. So you only need to worry about a few things to customize.
Obviously you need to configure which type of database you want to use as well as the location and credentials to access it. The defaults are configured in application.properties
that is bundled and deployed with the release of the software. The files should therefore contain the properties as in the given example:
database.url=jdbc:postgresql://database.enterprise.com/app
database.user.login=appuser01
database.user.password=************
database.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
database.hibernate.hbm2ddl.auto=validate
For further details about database.hibernate.hbm2ddl.auto
please see here. For production and acceptance environments we use the value validate
that should be set as default. In case you want to use Oracle RDBMS you can find additional hints here.
If your application supports multiples database types, set spring.profiles.active=XXX
in src/main/resources/config/application.properties
choose database of your choice. Also, one has to set all the active spring profiles in this application.properties
and not in any of the other application.properties
.
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International).