java.sql.SQLException: No suitable driver found for dbc:mysql://localhost
44 ビュー (過去 30 日間)
古いコメントを表示
I'm getting the error: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost
I have mysql-connector-java-5.1.14-bin.jar in my javaclasspath. I'm using the following code:
>> url = java.lang.String(['jdbc:mysql://localhost:3306']); >> db_conn = DriverManager.getConnection (url); ??? Java exception occurred: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
This worked for me previously, but not anymore! Anybody have any ideas? Thanks much Debbie
0 件のコメント
回答 (2 件)
Deborah
2011 年 8 月 9 日
2 件のコメント
Ali Esmaili
2020 年 5 月 7 日
I have done this on Matlab 2019b and it is not working. I am able to add the data source into the javaaddpath but it has no effect.
line hammer
2021 年 6 月 21 日
The reason you got this error is because you forgot to register your java mysql jdbc driver with the application.
Should be like this:
Class.forName("com.mysql.jdbc.Driver");
This forces the driver to register itself, so that Java knows how to handle those database connection strings.
You'll have to read the manual on your specific mysql jdbc driver to find the exact string to place inside the the Class.forName("...") parameter.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!