Unable to connect to database to retrieve data