A web service connects an HTTP client and an HTTP server (the service), not a DB. The service is of course free to connect to a DB, but that's no different than any other kind of Java code connecting to a DB.