Using Database Toolbox Interface for MongoDB in a Matlab Web App

5 visualizaciones (últimos 30 días)
Christian Idzik
Christian Idzik el 11 de En. de 2022
Comentada: Kojiro Saito el 13 de En. de 2022
Hi everyone,
I want to implement a simple GUI in Matlab's App Designer which acceses a MongoDB using the Database Toolbox Interface for MongoDB.
This works fine in the App Designer. Next, I compiled my GUI to a Matlab Web App. No error occurred during the compilation. However, an error is thrown during the runtime of the web app.
The error occurs when I try to connect to the database. I suspect that I need to somehow add the interface for MongoDB into the package to compile. But I have no idea how to do that, because only a mongodb.mlpkginstall can be downloaded in the file exchange.
Does anyone have any idea where the problem comes from and how to solve it?
Thank you all in advance!!!!
---
Here the simple code:
server = "111.222.33.44";
port = 27017;
dbname = "test";
app.conn = mongo(server,port,dbname);
In the Web App I got the following error message:
line 65 in my web app is app.conn = mongo(server, port, dbname)

Respuestas (1)

Kojiro Saito
Kojiro Saito el 13 de En. de 2022
JDBC driver of Mongo DB might not be included in your package file.
Aftere installing mlpkginstall file, the JDBC driver will be found in
C:\ProgramData\MATLAB\SupportPackages\R2020b\3P.instrset\mongodb.instrset\MongoDriver
as of Windows OS.
Please include this folder in "Files required for your app to run" setting of Web App Compiler, then package it again.
  3 comentarios
Christian Idzik
Christian Idzik el 13 de En. de 2022
Ah okay I found out that you can type matlabshared.supportpkg.getSupportPackageRoot in the command line to get the location of the SupportPackages
Kojiro Saito
Kojiro Saito el 13 de En. de 2022
Great! Sorry, I didn't know you're using Linux.

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by