MATLAB Version: 7.10.0.499 (R2010a)
Operating System:Microsoft Windows 7 Version 6.1 (Build 7600)
Java VM Version:Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM)Client VM mixed mode
MySQL:mysql-5.5.9-win32
JDBC:mysql-connector-java-5.1.15
按照JDBC链接步骤:
1.建立一个MYSQL数据库,比如mySQLDB,并下载相关JDBC驱动,比如我这里使用的:mysql-connector-java-5.0.6-bin.jar(注意一定要解压缩出.JAR文件)
2.为了MATLAB能够使用这个驱动文件,需要定义环境变量.打开并修改matlabroot/toolbox/local/classpath.txt这个文件,
比如我的JDBC-MYSQL驱动放在了matlabroot/class文件夹下,于是打开classpath.txt这个文件,并添加:$matlabroot/class/mysql-connector-java-5.0.6-bin.jar在文件最后一行,保存,关闭文本.
3.重新启动MATLAB
Matlab启动报错
ERROR: Error starting reference:file:/C:/Program Files/MATLAB/R2010a/class/mysql-connector-java-5.1.15-bin.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle 9: package; (package=javax.naming))
org.osgi.framework.BundleException: Unresolved constraint in bundle 9: package; (package=javax.naming)
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3097)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1439)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:984)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:263)
at java.lang.Thread.run(Unknown Source)
希望得到帮助,谢谢!
--转自