Why is MATLAB unable to find the JDBC Driver?

23 ビュー (過去 30 日間)
Raymond Chiu
Raymond Chiu 2018 年 7 月 24 日
コメント済み: Karim Ushama 2021 年 5 月 26 日
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
  1 件のコメント
Karim Ushama
Karim Ushama 2021 年 5 月 26 日
Did you solve the issue?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by