check if connection can be used to send queries to the database