Results 1 to 3 of 3
  1. #1
    aljassi is offline Member
    Join Date
    Oct 2012
    Posts
    5
    Rep Power
    0

    Default jdbc in matlab: com.mysql.jdbc.Driver cannot be found

    i wrote a db query method in java, when i query the db all thinks is okay.
    the problem is,i have to write the query method in java and call this in matlab cause i want to display result in matlab workspace

    i added the jdbc path in matlab
    i define my classpath, intantiate the class and when i call my java method to query db from matlab , i get this error:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at com.mathworks.jmi.CustomURLClassLoader.findClass(C lassLoaderManager.java:754)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)


    how can i fix it. please help me
    Last edited by aljassi; 06-01-2013 at 08:22 PM.

  2. #2
    aljassi is offline Member
    Join Date
    Oct 2012
    Posts
    5
    Rep Power
    0

    Default Re: jdbc in matlab: com.mysql.jdbc.Driver cannot be found

    hi everybody i found the result

    >> javaclasspath({'C:\Users\path\workspace\javaprojet \bin'})
    >> javaaddpath({'C:\Users\pathtoyourdriver\mysql-connector-java-5.1.24-bin.jar'})
    >> import you.package.YouClass
    >> x=YouClass('is my constructor')

    x =

    youpackage.yourclass@43eorbda

    >> c=x.query('select * from yourtable')

  3. #3
    Join Date
    Jun 2013
    Posts
    4
    Rep Power
    0

    Default Re: jdbc in matlab: com.mysql.jdbc.Driver cannot be found

    The library is not in the classpath. Please add the library in your classpath and retest

Similar Threads

  1. Replies: 5
    Last Post: 09-25-2012, 06:36 PM
  2. Replies: 0
    Last Post: 03-03-2012, 02:01 AM
  3. JDBC mysql driver
    By Eleeist in forum New To Java
    Replies: 23
    Last Post: 01-19-2012, 08:46 PM
  4. JDBC Problem - com.mysql.jdbc.Driver
    By icu222much in forum Advanced Java
    Replies: 5
    Last Post: 11-22-2011, 05:54 PM
  5. com.mysql.jdbc.Driver
    By uthpalaw in forum Eclipse
    Replies: 2
    Last Post: 10-14-2010, 06:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •