Connecting to a single node from a Java client
This recipe is about setting up the Java client for MongoDB. You will be repeatedly referring to this recipe while working on others, so read it very carefully.
The following are the prerequisites for this recipe:
- Version 1.6 or above of Java SDK is recommended.
- Use the latest available version of Maven. Version 3.1.1 was the latest at the time of writing this book.
- Use the MongoDB Java driver. Version 2.11.3 was the latest at the time of writing this book.
- Connectivity to the Internet to access the online Maven repository or a local repository is needed. Alternatively, you might choose an appropriate local repository accessible to you from your computer.
- The Mongo server is up and running ...