How to connect a MongoDb atlas database with Jaspersoft studio - mongodb

I'm developing a Java Spring boot application with MongoDb database (MongoDB Atlas) and trying to generate reports from backend with Jasper reporting services. I have followed several tutorials to do that. But all of them show how to connect to a local database. Since I'm using MongoDB Atlas I'm wondering how to give Mongo URI while setting up the Data Adapter (See image)
If anyone knows a better approach to generate reports without using Japer reporting, please mention that as well. Thanks in advance!

You need to have mongodb atlas properly setup before you can connect to it.
First click on Database Access under Security in mongo atlas dashboard and create a new user
Then click on Network Access again under Security and whitelist your IP. The following image allows anyone to connect to the db
Finally, go to your cluster and click connect and you will be presented the following dialog. Copy the connection string from it and paste it into your jaspersoft connected interface.
Make sure you replace the <password> with the password of the user created above
That should work!
UPDATE: here is a screenshot of successful connection to jasperreport studio

Related

When I try to create a mongodb datasource in BIRT that connects to mongodb atlas it just times out, how to fix this?

I'm trying to create reports in BIRT using data from a mongodb data source hosted in Atlas. I'm using a shard's mongodb:// URI and not a mongodb+srv://. I'm able to connect to this URI from Compass and Intellij, yet birt mongodb data source times out. Is there any way I can fix this?

How to choose MongoDB Connect to Cluster option?

I'm new to MongoDB and I'm having some problems with MongoDB recently.
I'm not sure about Connect with the MongoDB Shell, Connect your application, Connect using MongoDB Compass, what's the difference?
The current demand is. I want to directly allow connection from anywhere and create a user account password to log into this database, which option should I choose?
https://i.stack.imgur.com/iwYMf.png
In Connect your application tab, you get a link that you need to copy
and paste in your application you are building to connect it to the
database. Remember to replace your password and databse name.
In Connect using MongoDB Compass tab, you get a link that you need
to paste in your compass application(A desktop application that
makes your mongodb data handling so much easier). And again remember to replace
your credentials.
I'm not very fond of Mongodb shell. It's actually an extensible
command-line interface.

How to create a user of MongoDB created in Google Cloud Platform?

I´ve created a MongoDB instance using the Google Click to Deploy VM and I've added a firewall rule 0.0.0.0/0 and works fine using dataGrip or connecting from outside. But now I want to create an user account for obvious reasons and I don't know how to do it.
I've done it locally installing MongoDB and executing the command db.createUser(... but I don't know how to connect to the mongo db in google cloud and execute the same command in order to create the account.
Thanks and sorry my bad english.
I haven't used the click to deploy like you're describing, but my guess is, if you go here:
https://console.cloud.google.com/compute/instances
The instance that was created for you shows up, and in the row for the instance, look for the column that says Connect, you'll see a button that says SSH. Clicking that will open a window that will connect you to the VM. It should have the MongoDB client installed and you can run commands there as if you had installed it locally and create your user.

Connection to CloudBees database using MySQL Workbench

I've just uploaded my locally developed app to CloudBees. It works fine: I can load the web pages and it can access the database.
However, I cannot connect to its database (also provided by CloudBees) using MySQL Workbench or the command line tool. It always says
Can't connect to MySQL server on 'ec2-50-19-213-178.compute-1.amazonaws.com' (10060)
Any CloudBees configuration that I might be missing?
double check your database connection parameters using SDK : bees db:info -p <databasename>
you should be able to connect to DB using mysql workbench and other mysql tools.
In the MySQL forum exists a collection of links for various types of connections using MySQL Workbench. One is probably especially interesting for you as it deals with Amazon RDS databases. Among others it shows what connection parameters are needed.
Seems that there were some firewall problems in the corporate router that prevented me from connecting before. I tried at home and it worked.

not able to connect to mongodb because of unauthorized lock type

I am trying to connect to my mongodb deployed in jelastic cloud
If i try to use the test database already provided in the mongodb node in jelastic..it works fine.But if i create my own database and try to access the collections created in it ..i get the following exception
com.mongodb.MongoException: unauthorized db:appdb lock type:-1 client:192.168.1.53
Why is this happening?how can i resolve it?
I am reading the configuration from a file mydb.cfg
host=mongodb-***.jelastic.servint.net
dbname=appdb
user=admin
password=*****
When in Rock Mongo web interface pick the targeted db and go for 'More' in config panel.
This has to show you the list of users having rights for DB.
Did you set the user and rights for your custom collection?
Try to check the configuration under 'Authentication' section?
Anyway, supposedly admin user should have rights to all DBs. You can try to figure this issue out at Jelastic community
I had the same issue when connection to mongodb custom named database.
In order to succeed with the connection, I have created an user for my custom named database.
(I added the provided admin user with its password to the authorized users as the image shown).