Hi Maciej Bedlin,
If your application is hosted on Mendix Default Cloud, you will not have user credential access to the database, which is part of the agreement while procuring the cloud.
Odata is best in your case because you can write dynamic queries in the URL to filter the data.
You can also publish a REST service, but you will have to create separate methods when you are changing query parameters.
Mendix documentation: https://docs.mendix.com/refguide/exposing-data-to-bi-tools-using-odata/