This article will explain what are JDBC drivers, how to download the MongoDb JDBC driver and how to connect to MongoDb using DbSchema Free Database Designer.
JDBC drivers are Java library files with the extension .jar used by all Java applications to connect to the database. Usually, they are provided by the same company which implemented the MongoDb software. DbSchema Tool already includes an MongoDb driver, which is automatically downloaded when you connect to MongoDb.
Each JDBC driver is using a specific URL. The URL is a string (text) with a specific format, containing information about the host where the database is running, the port, username, database name, etc. The format is specific to each driver. Any wrong character in the URL may make the database connectivity fail, therefore we recommend installing DbSchema and try to get connected. Then you can find the right URL directly in the DbSchema connection dialog.
We open source our JDBC driver for MongoDb. DbSchema features for MongoDb are described here. The driver source code is accessible on GitHub.
The driver binaries can be downloaded as zip file, which you should uncompress.Download the zip, unpack and include the jar files in your classpath. The driver is compatible with Java 8. for any issues with the driver, you can write to us.
For accessing the driver source code please visit the GitHub repository:
The driver is written on top of the native MongoDb Java driver.
The driver URL is the same as in the MongoDb documentation.
Example :
mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]
The URL allows connecting to multiple databases. In DbSchema you can set this by choosing 'Custom URL' in the connection editor and entering the URL as string. For URL details check the MongoDb documentation.
Create an account by MongoDb Atlas and login. There you have an option to connect which will provide the URI. In the DbSchema Connection Dialog use manual URL configuration. On the same connection page you have also a link to change a user password in the database.
Installing DbSchema Free edition will help to test the database connectivity and the JDBC driver URL.
When the download finished please follow this steps:
There are two tabs you can use to connect. 'Compose URL' will ask for the host, port, username, etc., and will create the JDBC URL for you.
The 'Edit URL' will let you directly enter the JDBC URL.
You can use the first tab to connect, and then see the created URL in the second tab.