Connect Matlab to Sql server

8 ビュー (過去 30 日間)
fatma ghozzi
fatma ghozzi 2014 年 5 月 5 日
コメント済み: Friedrich 2014 年 5 月 6 日
I try to connect to Sql server via a jdbc driver : sqljjdbc4 is already insatalled and this is my code :
db = database('ChifcoProd-2013-12-12-11-37', 'dg', 'pass', 'com.microsoft.jdbc.sqlserver.SQLServerDriver',...
'jdbc:microsoft:sqlserver://localhost:1433;database=ChifcoProd-2013-12-12-11-37')
error:
db =
Instance: 'ChifcoProd-2013-12-12-11-37'
UserName: 'dg'
Driver: []
URL: []
Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
Message: 'JDBC Driver Error: com.microsoft.jdbc.sqlserver.SQLServerDriver. Driver Not Found/Loaded.'
Handle: 0
TimeOut: []
AutoCommit: 'off'
Type: 'Database Object'

採用された回答

Friedrich
Friedrich 2014 年 5 月 5 日
Hi,
have you followed the instructions here. Basically you need to add the driver jar to MATLAB JAVA Classpath. How this is done is explained in the link I posted.
  3 件のコメント
fatma ghozzi
fatma ghozzi 2014 年 5 月 5 日
編集済み: fatma ghozzi 2014 年 5 月 5 日
the problem that I don't know what means exactly 'com.microsoft.jdbc.sqlserver.SQLServerDriver' and what should I write in stade
Friedrich
Friedrich 2014 年 5 月 6 日
According to the doc (see the bottom of database function page) the pair is of the format:
JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
Database URL: jdbc:sqlserver://localhost:port;database=databasename
Try adjusting your call to match that format and try again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by