In this tutorial, you can configure the OM2M default database (H2) your way and, if needed, use an alternative system and set it up. (Therefore, database is referred as DB)
- OM2M project cloned and built (LINK TO THE TUTO)
- project opened in IDE for further modifications
Modify the default configuration
In the following guidelines, the modified constants are located in the config.in file. This file is located in the configuration folder in the product directory once you have cloned and built the project.
DB reset on startup
By default the DB is reset on startup of the platform that is to say data are deleted. To modify this configuration just change the following constant to false. This constant can be found in the config.ini file, in your product (IN, MN, etc.).
Use another User / password to access the DB
By default, the user and its password used to connect to the DB are "om2m". Of course you can use different user/pwd if you want to use another configuration for your persistence part. To change the user and its password, modify the two following constants:
Use a different location for DB file
To change the location of the DB file, you need to modify one constant in the config.ini file. (located in the configuration folder in the product (IN, MN, etc.). For the IN you have by default:
You can use any alternative path, just put it after the last ":" in the "jdbc\:h2\:" part like this: