![]() This presumes that the MongoDB server is running on localhost at the default port and that it is unsecured. Let's create a MongoClient, the simplest invocation is: MongoClient mongoClient = new MongoClient(new ServerAddress("localhost", 27017)) Note: the version shown in the examples above is the latest stable version at the time of writing but you can choose any version available here. Manual Inclusion: download the JAR file from here and add it to your project's classpath.Gradle: add the following dependency to your adleĬompile 'org.mongodb:mongo-java-driver:3.4.2'.Maven: add an entry to the section of your pom.xml.The MongoDB Java Driver is supplied as a JAR file and can be included in a project just like any other JAR. A running MongoDB server, more details on that here.
0 Comments
Leave a Reply. |