Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
OM2M/one/Advanced DB
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)
Contents
Prerequisites
- 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.).
org.eclipse.om2m.dbReset=false
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:
org.eclipse.om2m.dbUser=your_user org.eclipse.om2m.dbPassword=password
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:
org.eclipse.om2m.dbUrl=jdbc\:h2\:./database/indb
You can use any alternative path, just put it after the last ":" in the "jdbc\:h2\:" part like this:
org.eclipse.om2m.dbUrl=jdbc\:h2\:YOUR/PATH/ABSOLUTE/OR/RELATIVE