Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.ifpb.bdnc.start.write.factory; import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; /** * * @author miolivc */ public class MongoConnectionFactory { public static MongoClient getConnection() { return new MongoClient(new MongoClientURI("mongodb://localhost:27017")); } }