connect generator controller to database