test database connection before creating provider