controller connects to the sql database