Connect issue to SQL Server using x64bit Matlab
2 ビュー (過去 30 日間)
古いコメントを表示
All,
I am trying to connect to a SQL Server using x64 bit Matlab. What frustrates me is that both versions see the dBase but only my x32 bit Matlab can connect (same machine Win 7). This holds true even when I load the dBase driver in the 'conn' statement.
conn = database('SeverName','r******er','**','com.microsoft.sqlserver.jdbc.SQLServerDriver')
But when I attempt to connect(using: exec(conn,'sqlquery')) I receive the following error: Message: 'Function requires three or five arguments to be defined'
What is even more frustrating is that I can easily connect to the same dBase and pull data using the x64-bit version of R.
Any suggestions?
Note: I have left certain words purposely for security..and its required by my firm. -------------- O/S = Windows 7 Pro x64 SQL = SQL 2008 R2; driver = SQL Server Native Client 10.0 ver: 2009.100.1600.01
0 件のコメント
回答 (2 件)
the cyclist
2011 年 2 月 18 日
I'm on a Mac and I am using postgresql, so not sure how related this is, but I have to add my JAR file to the Java path:
javaaddpath('<path to file>/postgresql-8.3-604.jdbc3.jar');
Maybe that is different for your x64 than your x32?
2 件のコメント
Oleg Komarov
2011 年 2 月 19 日
- Download ans save somewhere the Microsoft SQL Server JDBC Driver 3.0: the page contains a FAQ section and links to extensive documentation.
- Add manually the fullpath of the .jar driver (we used sqljdbc4.jar) to matlabroot\toolbox\classpath.txt
- Check that the path was added correctly (it took us several attempts) with:
javaclasspath
.
If you want to use windows authentication when connecting to MSSQL Server: add the directory of the .dll file supplied with the driver (refer to the link above for more details).
Oleg
4 件のコメント
Oleg Komarov
2011 年 3 月 16 日
Yes it does look ok (if you copied it from cmd window after calling javaclasspath).
I think you're mistaking with the URL part, build it as:
URL = ['jdbc:sqlserver://' server ':' port ';database=' dbname '];
Or try my submission on the FEX.
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!