SQL revised & testing DB connection in app