i created a mongodb instance in mongolab It provided me with a connection URI.
mongodb://<dbuser>:<dbpassword>@ds041177.mongolab.com:41177/myclouddb
I used the following java code to connect to my database-
Mongo m = new Mongo();
com.mongodb.DBAddress dba=new DBAddress("mongodb://admin:[email protected]:41177/myclouddb");
m.connect(dba);
But this throws a NumberFormatException
java.lang.NumberFormatException: For input string: ""
What am i doing wrong?