Ok, I got my Database running fine now, it´s recording my items as it is supposed to.
Now one more question in direction SQL:
the database records the behavior of my sensor with the Value OPEN / CLOSED and the time when this happens. So my table has 2 columns and a lot of rows now.
How can I manage in openhab2 that the item shows me a value e.g. 1000 as an initial value and than adds +1 whenever the sensor writes an OPEN into the database?
In the end I want to have a power consumption measurement which shows me tha actual KWh consumption / month and I also like to build a diagram where I can see at which time most power was consumed.
edit: I think I need another table, let´s name it StromZ, inside the db with the initial Value (e.g. 1000) where +1 gets added whenever item StromZK gets an OPEN!?! I have no idea how to realise this. From my expirience now openhab only generates a table for an item when it gets an update, but how should I update an item like StromZ which is not attached to a sensor?