Reading from a Database and Reconnecting if connection is Lost
Do you have an example script that will read from a database but will also reconnect to it if the connection to the database is lost?
We do have example code to help you reconnect to the database if it is lost. Please see the attached script example. This is different from the provided tutorials in a few ways. It adds a variable call is_connected. When the DataHub connects to the Database the flag is set to true. If an error occurs and we disconnect, the flag is set to false. A re-connection method is run at an interval to attempt to reconnect if the flag is false or not connected. See the attached script for details.
Running the Script
Go to the Scripting section in the DataHub. Then click Add and the script. Then you can highlight the script and click Load Now to load the script once. Or you can check the box next to it and click apply to make it run on every start up and then restart the DataHub to load the script.