Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JDBC driver error

6 views
Skip to first unread message

William Shobe

unread,
Dec 31, 2009, 10:04:03 AM12/31/09
to
I am running MatLab 7.9 (R2009b) on a 64-bit Intel Mac running OS 10.5.8. I am trying to set up a JDBC driver for MySQL to use with the database toolbox. I downloaded the most recent 'jar' file from the MySQL site, copied it to /System/Library/Java/Extensions, and added the following line to the classpath.txt file:

/System/Library/Java/Extensions/mysql-connector-java-5.1.10-bin.jar

When I load MatLab, I receive the following error:

ERROR: Error starting reference:file:/System/Library/Java/Extensions/mysql-connector-java-5.1.10-bin.jar (org.osgi.framework.BundleException: Unresolved package in bundle 10: package; (package=javax.naming))
org.osgi.framework.BundleException: Unresolved package in bundle 10: package; (package=javax.naming)
at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1728)
at org.apache.felix.framework.Felix._startBundle(Felix.java:1591)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1544)
at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1125)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
at java.lang.Thread.run(Thread.java:637)

Does anyone know what might be wrong and how I might fix it?

Thanks.

Oleg Komarov

unread,
Dec 31, 2009, 10:28:03 AM12/31/09
to
"William Shobe"
Check with javaclasspath if the path was added correctly.
Be aware that the '/System/Library/Java/Extensions/mysql-connector-java-5.1.10-bin.jar'
is not sufficient to locate the .jar file. You must supply the enire path: c:\nui\bnij\...

Oleg

William Shobe

unread,
Dec 31, 2009, 11:16:04 AM12/31/09
to
"Oleg Komarov" <oleg.k...@hotmail.it> wrote in message <hhifu3$rhk$1...@fred.mathworks.com>...

Oleg,

Thanks for you response.

(1) My system variable $CLASSPATH is:

/System/Library/Java/Extensions:/System/Library/Java/Extensions/mysql-connector-java-5.1.10-bin.jar:

(2) Since this is a Mac (Unix OS), I think that the path I gave IS the full path.

MatLab seems to be finding the file but finding something wrong with it.

Bill

William Shobe

unread,
Dec 31, 2009, 1:26:04 PM12/31/09
to
"William Shobe" <wm...@virginia.edu> wrote in message <hhiio4$pus$1...@fred.mathworks.com>...

I fixed it by reinstalling MatLab. Apparently, I had pre-release versions of some of the MatLab files, but the database toolbox was a final version. The reinstall fixed it.

It is working now.

Oleg Komarov

unread,
Dec 31, 2009, 1:31:05 PM12/31/09
to
"William Shobe"
I still think you should try to re-add the path.

This is what i get when i type in the command pane:
>> javaclasspath

STATIC JAVA PATH

C:\Program Files\MATLAB\R2009b\java\patch
C:\Program Files\MATLAB\R2009b\java\jar\util.jar
...
C:\Program Files\MATLAB\R2009b\sqljdbc_2.0\enu\sqljdbc4.jar

DYNAMIC JAVA PATH

<empty>
1) You can try to add the path with javaaddpath
2) As you can see each path is on a separate row (I had problems before because manually i copuldn't somehow add it correctly, it kept adding two paths on the same row!).

Oleg

0 new messages