Sree Karthik S R
Sree Karthik S R

Reputation: 367

what is the JDBC driver class name for mongodb?

Like com.mysql.jdbc.Driver in the case of mysql, what would be the JDBC driver class for mongodb?

In java code, it can be obtained as

MongoClient mongoClient = new MongoClient("localhost");

but in the case of JMeter, it requires JDBC driver class name.

Upvotes: 12

Views: 29031

Answers (4)

Pramod Kharade
Pramod Kharade

Reputation: 2085

In Java:

// To connect to mongodb server
         MongoClient mongoClient = new MongoClient( "localhost" , 27017 );

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 167992

In JMeter version 2.10 2 new test elements were introduced:

  1. MongoDB Source Config
  2. MongoDB Script

Which can be used for sending requests to MongoDB server as an alternative to JDBC Request Sampler.

In JMeter version 2.11 built-in MongoDB Java driver has been updated to mongo-java-driver-2.11.3

Upvotes: 2

Lasitha Benaragama
Lasitha Benaragama

Reputation: 2209

You can use it as Below.

JDBC Driver class name: mongodb.jdbc.MongoDriver URL format:
jdbc:mongo://(serverName)/(databaseName)

For More Details Refer this Link

Upvotes: 2

Vignesh Shiv
Vignesh Shiv

Reputation: 1157

You can try and use below details as reference

JDBC Driver class name: mongodb.jdbc.MongoDriver

URL format:jdbc:mongo://<\serverName>/<\databaseName>

e.g. url="jdbc:mongo://ds029847.mongolab.com:29847/tpch";

Con = DriverManager.getConnection(url, "dbuser", "dbuser");

Hope this will help.

Upvotes: 10

Related Questions