Why is MATLAB unable to find the JDBC Driver?

조회 수: 18 (최근 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

카테고리

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