Why is MATLAB unable to find the JDBC Driver?

25 次查看(过去 30 天)
Attempts, from MATLAB, to connect to a database fail.
conn = database(dbsource,username,password,'Vendor','MySQL', 'Server','mysql8.db4free.net','portnumber',3306)
Error message: *Unable to find JDBC driver*
[![enter image description here][1]][1]
The [JDBC driver][2] was:
- copied from [https://dev.mysql.com/downloads/file/?id=477058][3]
- copied to C:\drivers\mysql-connector-java-8.0.11\mysql-connector-java-8.0.11.jar
- added to the JDBC static path
- path \ filename was verified:
[![enter image description here][4]][4]
QUESTIONS ====
1) Is there enough information here to diagnose the root cause of the error message?
2) What is the root cause and corrective action?
3) Why does MATLAB indicate the JDBC driver file is not on the java classpath? Remedy?
Responses to requests for additional diagnostic information will be added to the original posting.
UPDATE === Attempt to configure MATLAB's database explorer app returned the message:
JDBC driver file was not found on MATLAB java classpath
[![enter image description here][5]][5]
Java version:
[![enter image description here][6]][6]
[1]:
[2]:
[3]:
[4]:
[5]:
[6]:
  1 个评论
Walter Roberson
Walter Roberson 2018-7-24
You show the JAVA dynamic path as being empty. I do not see where you are adding C:\drivers\mysql-connector-java-8.0.11\mysql-connector-java-8.0.11.jar to your MATLAB classpath ?

请先登录,再进行评论。

采纳的回答

Raymond Chiu
Raymond Chiu 2018-7-25
A clever peer solved this problem with V5.1:
Connector/J 8.0 (including mysql-connector-java-8.0.11.jar) supports only JRE 1.8.x. But MATLAB R2017a uses JRE 1.7, so mysql-connector-java-8.0.11.jar is not supported in R2017a.
Connector/J 5.1 Connector/J 5.1 supports JRE 1.7, so it works with MATLAB R2017a and also it supports MySQL Server 8.0.

更多回答(1 个)

Pieume Ulrich
Pieume Ulrich 2019-5-1
Hello guys I'm using the R2017b and i consulted the version of my JRE and saw that it was 'Java 1.8.0_121-b13'. with this advance i am eligable for the 'mysql-connector-java-8.0.11.jar' driver but yet I still have the same response 'JDBC driver is not found on MATLAB java class path'.
Please I would like to have the complete procedure to connect my MATLAB to mysql using 'JDBC' driver please,
ùy email: pieumeulrich@gmail.com

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by