I want to connect my MongoDB remote server with the help of java. My code is as follows:
URL = "jdbc:mongo://" + serverIP + ":"
+ port+ "/" +databaseName;
Class.forName("mongodb.jdbc.MongoDriver");
dbConn = getConnection(URL,mongo1, mongo1);
I have also implemented the Unity_trial.Jar, mongo_version.jar files but the error displays as:
'mongodb.jdbc.MongoDriver' classNameNotFound.
If I add class.forname as the comment then this will display the below error:
URL = "jdbc:mongo://" + serverIP + ":" + port
+ "/" +databaseName;
which is not in the correct format.
I am not able to understand this. Can you help me?