checks whether a connection to a database can be established