Database function error message

1 visualización (últimos 30 días)
Max Trivedi
Max Trivedi el 7 de Jul. de 2022
Respondida: Dinesh el 17 de Nov. de 2023
Attempting to connect to microsoft analysis service sql server to pull data from a tabular model using jdb4olap driver, when running the database command with required inputs connection always fails with the following error message in red text:
WARNING: ConnectionID:7 ClientConnectionId: 44c0cefa-45cf-4456-8aaa-1fc4e4a54aac Prelogin error: host [servername] port 55989 Error reading prelogin response: Connection reset ClientConnectionId:44c0cefa-45cf-4456-8aaa-1fc4e4a54aac
Jul 05, 2022 3:29:37 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
Using the JDBC Data Source Configuration panel in database toolbox gives the same error when testing the connection.
I am struggling to debug this to find out what the problem is. Any help would be appreciated.

Respuestas (1)

Dinesh
Dinesh el 17 de Nov. de 2023
Hi Max.
The error that you are facing is most likely because you are using "MySQL" as DB and trying to connect to "SQLSERVER DB" in your code.
Here's a sample code to connect to a MySQL database:
conn = database('your_database', 'your_username', 'your_password', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://hostname:port/your_database');

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by