Yes you can. As long as the database server is available
remotely. You would need the IP of the database server.
However, keep in that for every request that involves a
query, you are going to have to make that jump from one server to
the other. This could add a considerable amount of time to your
request.