You can connect to a web service by using the Socket object to write http requests.
If you know the DB's connection protocol, you theoretically could write the interface code using the Socket as well.
You can create a java class to do it. Call the class, write the data to a file, and then read it. You can do synchronous Java calls on a Mac, on PC they must be asynchronous, which will increase complexity.