How can I access MS SQL Server from MATLAB web application

조회 수: 2 (최근 30일)
Johnny Birch
Johnny Birch 2020년 9월 1일
편집: Tamir Suliman 2020년 9월 1일
I am trying to connect to a MS SQL Server with success when using this code:
datasource = "NAME";
username = "xxx";
password = "yyy";
conn = database(datasource,username,password);
However, when i wnat to specify connection details to be able to connect from a deployed web application I get en error
databasename = "NAME";
username = "xxx";
password = "yyy";
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
url = "jdbc:sqlserver://localhost:1433;databaseName=NAME";
javaaddpath('C:\Microsoft SQL server\sqljdbc_8.4\enu\mssql-jdbc-8.4.1.jre8.jar');
conn = database(databasename,username,password,driver,url);
This is the error I get
Error using database (line 59)
Unmatched parameter name 'com.microsoft.sqlserver.jdbc.SQLServerDriver' must be a string scalar or character vector
that can represent a field name.

답변 (1개)

Tamir Suliman
Tamir Suliman 2020년 9월 1일
편집: Tamir Suliman 2020년 9월 1일
you could attempt to remove that line making sure data source is specified if I m reading the matlab documentation correctly or use ' instead of "

카테고리

Help CenterFile Exchange에서 JSON Format에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by