Obviously this is not all you are looking for, this will provide you a basic idea of connecting a mongo DB using java. The easiest DB connection so far I have seen is this. All you need to do is download the driver class or include it in your pom dependency and create a main class with two method calls.