Connecting to a database and reading remote data