Do I understand right:

My Favorit:

- If I donâ€™t change my default persistence to JDBC, I must insert a Code into my rule with JDBC.

(Can you tell me where in the code i must write down the â€śJDBCâ€ť?)

Not so good:

- If I change the default persistence to JDBC, I donâ€™t must insert the JDBC code.

Here is my jdbc.persist file:

```
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
Items {
Shelly3EMSHEM3_KumulierterVerbrauch : strategy = everyMinute, everyDay, restoreOnStartup
Shelly3EMSHEM3_KumulierterGesamtverbrauch : strategy = everyMinute, everyDay, restoreOnStartup
Shelly3EMSHEM3_Leistung1 : strategy = everyMinute, everyDay, restoreOnStartup
Shelly3EMSHEM3_Leistung2 : strategy = everyMinute, everyDay, restoreOnStartup
Shelly3EMSHEM3_Leistung3 : strategy = everyMinute, everyDay, restoreOnStartup
Shelly3EMSHEM3_KumulierteEinspeisung : strategy = everyMinute, everyDay, restoreOnStartup
ShellyHeizstab1_Temp1 : strategy = everyMinute, everyDay, restoreOnStartup
Shelly_Temperatur_HW_Puffer : strategy = everyMinute, everyDay, restoreOnStartup
Shelly1_Temperatur_HW_RL : strategy = everyMinute, everyDay, restoreOnStartup
Sma_PowerL1 : strategy = everyMinute, everyDay, restoreOnStartup
Sma_PowerL2 : strategy = everyMinute, everyDay, restoreOnStartup
Sma_PowerL3 : strategy = everyMinute, everyDay, restoreOnStartup
Sma_ActivePowerWatt : strategy = everyMinute, everyDay, restoreOnStartup
Sma_DaylyYield : strategy = everyMinute, everyDay, restoreOnStartup
Sma_TotalYield : strategy = everyMinute, everyDay, restoreOnStartup
Verbr : strategy = everyHour, restoreOnStartup
Einsp : strategy = everyHour, restoreOnStartup
Gesamteinspeisung : strategy = everyHour, restoreOnStartup
Gesverbr1 : strategy = everyHour, restoreOnStartup
}
```

Here is the rule:

```
var dtf = Java.type("java.time.format.DateTimeFormatter");
var zdt = Java.type("java.time.ZonedDateTime");
function getZonedDateTime (datetime)
{
return zdt.parse(datetime + ' 00:00:00 +00:00', dtf.ofPattern('yyyy-MM-dd HH:mm:ss z'))
}
var persistence = Java.type('org.openhab.core.persistence.extensions.PersistenceExtensions');
events.postUpdate('Gesverbr1', (persistence.sumSince(itemRegistry.getItem('Verbr'), getZonedDateTime('2022-01-01'))));
events.postUpdate('Gesamteinspeisung', (persistence.sumSince(itemRegistry.getItem('Einsp'), getZonedDateTime('2022-01-01'))));
```