Created
October 17, 2011 01:16
-
-
Save jasonmccay/1291694 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspecting what the Mongo library makes available, we see that we will | |
// need the following: | |
// A Mongo class that takes the server name and the port. | |
// A DB class that takes the name of the database | |
// Declare a boolean variable that will hold the authentication status of the authenticate method on the db object. | |
public static void main(String[] args) { | |
Mongo m = new Mongo( "hatch.mongohq.com" , 10004 ); | |
DB db = m.getDB("my_database_name"); | |
boolean auth = db.authenticate("cloudbees", "my_database_password".toCharArray()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment