Database function error message

6 次查看(过去 30 天)
Max Trivedi
Max Trivedi 2022-7-7
回答: Dinesh 2023-11-17
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.

回答(1 个)

Dinesh
Dinesh 2023-11-17
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');

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by