Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Unable to find JDBC Driver error on Linux server

Subject: Unable to find JDBC Driver error on Linux server

From: Hariprasad

Date: 27 May, 2013 09:15:09

Message: 1 of 4

Hi, I have to run a script which basically connects to MySQL database on Linux server and pulls data from a table. I'm trying this on Linux server with MATLAB Installed on the server as well. I have installed MySQL. I used the below function:

conn = database('Database','username','password','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/database-name');

and

conn = database('Database','username','password','Vendor','MySQL','Server','Server name');

 but when i run the above codes, i get this error :

conn =

       Instance: 'database'
       UserName: 'username'
         Driver: []
            URL: []
    Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
        Message: 'Unable to find JDBC driver.'
         Handle: 0
        TimeOut: 0
     AutoCommit: 'off'
           Type: 'Database Object'

i have installed mysql-connector-java-5.1.16.jar

please let me know where I'm going wrong.

Subject: Unable to find JDBC Driver error on Linux server

From: Ed Yu

Date: 8 Dec, 2013 19:55:06

Message: 2 of 4

You need to include the JDBC jar file in your path... Look at command javaclasspath.

"Hariprasad" wrote in message <knv86s$f10$1@newscl01ah.mathworks.com>...
> Hi, I have to run a script which basically connects to MySQL database on Linux server and pulls data from a table. I'm trying this on Linux server with MATLAB Installed on the server as well. I have installed MySQL. I used the below function:
>
> conn = database('Database','username','password','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/database-name');
>
> and
>
> conn = database('Database','username','password','Vendor','MySQL','Server','Server name');
>
> but when i run the above codes, i get this error :
>
> conn =
>
> Instance: 'database'
> UserName: 'username'
> Driver: []
> URL: []
> Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
> Message: 'Unable to find JDBC driver.'
> Handle: 0
> TimeOut: 0
> AutoCommit: 'off'
> Type: 'Database Object'
>
> i have installed mysql-connector-java-5.1.16.jar
>
> please let me know where I'm going wrong.

Subject: Unable to find JDBC Driver error on Linux server

From: Yair Altman

Date: 8 Dec, 2013 20:22:10

Message: 3 of 4

The JDBC jar file needs to be included in your static Java classpath (i.e., not javaaddpath but the classpath.txt file). Look in the DB Toolbox's documentation for details.

Yair Altman
http://UndocumentedMatlab.com
 

Subject: Unable to find JDBC Driver error on Linux server

From: Jeff

Date: 24 Apr, 2014 01:46:08

Message: 4 of 4

Where does class path.txt go in a deployed application? I’m having the same issue with the JDBC driver.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us