フィルターのクリア

Matlab Database gives Java exception

5 ビュー (過去 30 日間)
Benjamin
Benjamin 2015 年 10 月 21 日
回答済み: Benjamin 2015 年 10 月 29 日
I have used the Matlab Database toolbox for a long time but today it suddenly fails. If I go go Apps>Database Explorer I get the error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.toolbox.database.databasePrefs
at com.mathworks.toolbox.database.gui.DatabaseToolstripTab.<init>(DatabaseToolstripTab.java:242)
...
If for example I write
setdbprefs('DataReturnFormat','structure');
I get the error
Error using javaObject
No class com.mathworks.toolbox.database.databasePrefs can be located on the Java class path
Error in setdbprefs (line 58)
DatabasePrefs = javaObject('com.mathworks.toolbox.database.databasePrefs');
If I write
database(server_name,'','','com.microsoft.sqlserver.jdbc.SQLServerDriver', ...
['jdbc:sqlserver://',server_name,':',num2str(port_nr),';database=',database_name,';integratedSecurity=true;']);
I get the error
Error using database (line 309)
Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.toolbox.database.databasePrefs
at com.mathworks.toolbox.database.databaseConnect.makeDatabaseConnection(databaseConnect.java:140)
I have reinstalled Matlab including the Database toolbox and I have reinstalled Java. I have also downloaded the jdbc driver again in case there was some damage to those files. Still it does not work. I do not know of any changes on my computer since yesterday where everything works.
Thanks for any inputs. Benjamin

採用された回答

Rahul Goel
Rahul Goel 2015 年 10 月 26 日
Hi Benjamin,
You can try the following steps to see if it resolves it:
1. Go to the preference directory by executing the following command in the MATLAB command prompt:
>>winopen(prefdir)
2. Look for the file named 'database', change the name of the file to something different ie: 'database_old'
3. Restart MATLAB and check that the file still have the same name ie: 'database_old'.
Hope this helps.

その他の回答 (1 件)

Benjamin
Benjamin 2015 年 10 月 29 日
Thanks! Worked :)

カテゴリ

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