Connecting to Mongo database through SSH tunnel in Java
问题 FIXED (edited code to reflect changes I made) I'm trying to connect to a Mongo database through an SSH tunnel using Java. I'm using the Mongo driver 3.0.2 and jcraft (JSch) to create an SSH tunnel. The idea is that I: connect to the machine hosting the MongoDB installation through SSH set up port forwarding from a local port to the remote MongoDB port connect to MongoDB remotely My code looks like this: // forwarding ports private static final String LOCAL_HOST = "localhost"; private static