Mongo Atlas is widely used the hosted Mongo DB service. SQuirreL SQL Client is a graphical Java program that will allow you to view & query data sources using JDBC.

In this blog we demonstrate how to connect SQuirreL to Mongo DB 4.0 cluster with 3 Replica Sets ( 1 primary + 2 secondary) using the Simba MongoDB JDBC driver.

  1. Add a new driver in SQuirreL; using the Driver – New Driver menu option
    MongoDB add new Driver
  2. Under the Extra Class Path select all the jar files provided with the Simba Mongo JDBC driver.
    Add MongoDB Jars
  3. Add the Name, Example URL & the Website URL the Class Name should populate automatically if the driver is successfully loaded.
    MongoDB Driver loaded
  4. Click on OK and you should see a message in green indicating the driver has been loaded.
  5. Create a new Alias
    MongoDB Create New Alias
  6. Name the Alias,
    Select the MongoDB Atlas driver from the Driver drop down menu.
    URL use :

    jdbc:mongodb:<id>:<password>@//<ReplicaSet1:27017>,<ReplicaSet2:27017>,<ReplicaSet3:27017>/<DBName>?ssl=true&replicaSet=<ReplicaSetName>&authSource=admin&authMechanism=SCRAM-SHA-1

    MongoDB Atlas add alias
    Do ensure all the parameters in the URL connection string including the Replica set names, port are set correctly.

    ssl=true& authSource=admin&authMechanism=SCRAM-SHA-1

    are required too.
    Id/passwd can be part of the URL; in which case the User Name/Password fields can be empty.


  7. Test the connection
    MongoDB Atlas test connection
  8. Double click on the newly created alias which should connect to the DB. You are now able to run SQL-92 queries on your Mongo DB Atlas. Type your query into the window and then click the run icon.
    MongoDB Atlas Execute SQLQuery
  9. Congratulations! You should also be able to view the list of tables & their content.
    MongoDB Atlas tables list

Now it's your turn !