Package com.massivecraft.mcore.xlib.mongodb

Examples of com.massivecraft.mcore.xlib.mongodb.MongoClient


    private static Mongo _mongo = null;

    private static Mongo getMongo()
        throws Exception {
        if ( _mongo == null )
            _mongo = new MongoClient( host );
        return _mongo;
    }
View Full Code Here


    MongoClientURI muri = new MongoClientURI(uri);
   
    try
    {
      // TODO: Create one of these per collection? Really? Perhaps I should cache.
      MongoClient mongoClient = new MongoClient(muri);
     
      DB db = mongoClient.getDB(muri.getDatabase());
     
      if (muri.getUsername() == null) return db;
     
      if ( ! db.authenticate(muri.getUsername(), muri.getPassword()))
      {
View Full Code Here

TOP

Related Classes of com.massivecraft.mcore.xlib.mongodb.MongoClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.