checks whether a connection with the database can be established