Test if DB connection is valid ?

My app needs to query different databases. At the moment, I test the connection to a database with a simple "select 1 from dual" query. However, if the DB is not reachable, the query takes a good amount of time. I have thought about taskqueue but the problem is, that I have to handle the DB-Credentials in a persistent entity for this, which I feel is not the best solution. Are there any suggestions how to handle this? Is there a way to set a time-out for a microflow? I appreciate your help :)
1 answers

Maybe just create a simple java action to test the connection. See here an example for oracle: https://stackoverflow.com/questions/18756113/how-to-test-connection-to-oracle-database-using-java