While using MySQL as databases in Servoy,at times users experience issues of disconncted database services. The tip below describes the potential problem and the quick and easy fix for the same.
For using MySQL as database in Servoy, we need to first create a server connection for the same and we generally use the “com.mysql.jdbc.Driver” driver to connect to the MySQL database instance. There is a known bug (as of now) in this driver, that it times out, after several hours of idle connection,throwing connection exceptions. The possible solution for the same is specifying a Validation Query for the server connection in Servoy. Steps:
1) Open the used server connection for the MySQL database.
2) Select the “Validation Type” as “query validation”.
3) Specify the below query in the “Validation Query” box.
This will keep your database connection always active,resolving the above said issue.