|
Re: Kura and use of database [message #1708751 is a reply to message #1708680] |
Sun, 20 September 2015 07:45 |
|
Hi Silvio,
If I am not wrong, you want to save your data locally to your Kura Device. First of all, Eclipse Kura doesn't provide any packaged database with it but it has HyperSQL accessor OSGi Bundle which would help you to mange your own HyperSQL Databases.
There are quite a few no of ways you can follow to manage your own HyperSQL Database using Kura's DBService.
You have to configure Kura System Properties with the proper configuration Parameters for your HyperSQL Connection.
1. You can create an OSGi Metatype Bundle to configure the required system properties using Kura's SystemService
2. Or you can configure the parameters in proper configuration properties file in Eclipse Kura
After configuring your HyperSQL Configuration Parameters, you can use DBService to access the database to store and retrieve data locally.
For your reference, do find the required system properties which you have to set. I have created the Metatype configuration file which you can use to set the System Properties externally by creating an OSGi Metatype Bundle.
<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.2.0"
localization="en_us">
<OCD id="com.amitinside.hsql.conf" name="HyperSQL"
description="This is used to configure HyperSQL Connection">
<Icon
resource="http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Places-server-database-icon.png"
size="32" />
<AD id="db.service.hsqldb.url" name="db.service.hsqldb.url" type="String"
cardinality="0" required="true" default="jdbc:hsqldb:hsql://localhost/iva"
description="Configurable property to set HyperSQL Connection URL" />
<AD id="db.service.hsqldb.cache_rows" name="db.service.hsqldb.cache_rows"
type="Integer" cardinality="0" required="false" default="50000"
description="Configurable Property to set caching of rows" />
<AD id="db.service.hsqldb.lob_file_scale" name="db.service.hsqldb.lob_file_scale"
type="Integer" cardinality="0" required="false" default="32"
description="Configurable Property to set lob file scaling size" />
<AD id="db.service.hsqldb.defrag_limit" name="db.service.hsqldb.defrag_limit"
type="Integer" cardinality="0" required="false" default="0"
description="Configurable Property to set defragmentation limit" />
<AD id="db.service.hsqldb.log_data" name="db.service.hsqldb.log_data"
type="Boolean" cardinality="0" required="false" default="false"
description="Configurable Property to set log data" />
<AD id="db.service.hsqldb.log_size" name="db.service.hsqldb.log_size"
type="Integer" cardinality="0" required="false" default="50"
description="Configurable Property to set log size" />
<AD id="db.service.hsqldb.nio_data_file" name="db.service.hsqldb.nio_data_file"
type="Boolean" cardinality="0" required="false" default="true"
description="Configurable Property to set NIO data file" />
<AD id="db.service.hsqldb.write_delay_millis" name="db.service.hsqldb.write_delay_millis"
type="Integer" cardinality="0" required="false" default="500"
description="Configurable Property to set write delay in milliseconds" />
</OCD>
<Designate pid="com.amitinside.hsql.conf">
<Object ocdref="com.amitinside.hsql.conf" />
</Designate>
</MetaData>
I hope it helps.
Amit Kumar Mondal
Email: admin@amitinside.com
Skype: arsenalnerk Blog: blog.amitinside.com
[Updated on: Sun, 20 September 2015 08:58] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04655 seconds