Connect from DBeaver
On this page
This page describes how to connect to your federated database instance with DBeaver.
Prerequisites
A federated database instance mapped to one or more data stores.
Note
If some or all of your data comes from an Atlas cluster, you must use MongoDB version 5.0 or greater for that cluster to take advantage of Atlas SQL.
Procedure
To connect to your federated database instance from DBeaver:
Select JDBC Driver.
Note
This tutorial uses the JDBC Driver to connect. See Connect for alternative connection methods.
Connect from DBeaver.
Add a new driver.
In DBeaver, click Database and select Driver Manager from the dropdown menu.
Click New to open the Create new driver modal.
In the Settings tab, enter the following information:
Driver NameMongoDB
Class Namecom.mongodb.jdbc.MongoDriver
In the Libraries tab, click Add File and add your JDBC driver
all.jar
file.Click Find Class.
Click OK. The Create new driver modal closes.
Create a database connection.
In DBeaver, click Database and select New Database Connection from the dropdown menu to open the Connect to a database modal.
From the list of databases, select the
MongoDB
database driver that you created in the previous step.Tip
If you don't see
MongoDB
, select the All category inside the modal.Click Next.
In the Main tab, enter the following information:
JDBC URLYour connection string from step 5.UsernameThe MongoDB user to connect with.PasswordThe MongoDB user's password.In the Driver properties tab, expand User Properties. Add the following key-value properties:
databaseThe name of your virtual database.userThe MongoDB user to connect with. Not required if you entered aUsername
in the previous step.passwordThe MongoDB user's password. Not required if you entered aPassword
in the previous step.Tip
If you created your first virtual database during this tutorial, your database's name is
Database0
. Otherwise, find your virtual database's name in your Atlas SQL federated database instance interface under the Data Federation tab.
Run SQL Queries
To run SQL queries in DBeaver:
Try running the following Atlas SQL queries against the Get Started sample federated database instance, or modify them to read your own data.
SELECT Statement
SELECT * FROM Sessions
Atlas SQL returns all documents from the Sessions
collection.
LIMIT Statement
SELECT * FROM Users LIMIT 2
Atlas SQL returns two documents from the Users
collection.
WHERE Statement
SELECT * FROM Users WHERE name='Jon Snow'
Atlas SQL returns documents from the Users
collection where the user's name
is Jon Snow
.
For an Atlas SQL command reference, see SQL Reference.