Connection not working

Hello, I am trying to generate a Grid-App. The connection says it is working. But after generating it says, it can get no connection to the database, What could be the case?