-
Notifications
You must be signed in to change notification settings - Fork 44
Stream Exporter
This virtual sensor exports the data it receives to the database of your choice. This can be interesting when debugging your GSN configuration or to easily back up critical data on an independent machine. It can also be used to log unexpected events for later off-line, manual analysis. It can receive any number of input streams. Each one will be saved into a separate table named after the input stream.
It requires a JDBC URL and a user name and password so that it knows where is the database server and how to authenticate. This virtual sensor inserts the data into the specified table. If the table doesn't exist, GSN first create this table and if the table exists, GSN first verifies the structure of the table with the structure of the produced stream elements. If the structure matches, GSN starts inserting data into the table otherwise it stops with an error message to inform the user about the incompatible structures.
Parameters:
- url A JDBC url that specifies how to connect to the database server.
- driver The jdbc driver to be used to connect to the database.
- user The user name for authentication with database server.
- password The password for authentication with database server.
- table The name of the table into which GSN will store the sensor data
Example:
<class-name>gsn.vsensor.StreamExporterVirtualSensor</class-name>
<init-params>
<param name="url">jdbc:mysql://localhost:3306/gsntest</param>
<param name="user">root</param>
<param name="password"></param>
<param name="driver">com.mysql.jdbc.Driver</param>
<param name="table">mytable</param>
</init-params>
...