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

java.lang.ClassNotFoundException

7 views
Skip to first unread message

Tim Sodergren

unread,
Jan 21, 2005, 12:05:27 AM1/21/05
to
I am trying to access MySQL in Matlab using JDBC, not the JDBC/ODBC
bridge and keep getting a ClassNotFoundException:

>> javaaddpath
C:\j2sdk1.4.2_06\jre\lib\ext\mysql-connector-java-3.1.6-bin.jar
>> java.lang.Class.forName('com.mysql.jdbc.Driver')
??? Java exception occurred:
java.lang.ClassNotFoundException: com/mysql/jdbc/Driver

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

I checked the path with javaclasspath and verified it is there. Also
I know the jar file exists because I can use it with external Java
code. Any suggestions?

Tim Sodergren

unread,
Jan 21, 2005, 12:22:37 AM1/21/05
to
Also wanted to add that I can use this driver with the Database
toolbox like so:

conn=database('dbname','user','password','com.mysql.jdbc.Driver','jdbc
:mysql://localhost/dbname')

This is only a demo of the toolbox and I don't intend on using it as
inserts are extremely slow.

I see that others have had this problem but I haven't seen any
solutions.

>>
conn=database('test','root','root','com.mysql.jdbc.Driver','jdbc:mysql
://localhost/test')

0 new messages