简体   繁体   English

在库中找不到适用于jdbc:mysql netbeans,* .jar的驱动程序

[英]No suitable driver found for jdbc:mysql netbeans, *.jar include in library

I can perform the connection in worbanch, but with the same username and password can not connect through the application in the mysql database. 我可以在worbanch中执行连接,但是使用相同的用户名和密码无法通过mysql数据库中的应用程序进行连接。 I checked the syntax apparently seems to be correct. 我检查了语法,看来似乎是正确的。 I would like to help to solve this problem as the .jar is already in the library folder of Java SE project. 我想帮助解决此问题,因为.jar已在Java SE项目的库文件夹中。

print screen: 打印屏幕:

Screen 1 屏幕1

screen 2 屏幕2

ERROR CONSOLE: No suitable driver found for jdbc:mysql://127.0.0.1/sakila 错误控制台: No suitable driver found for jdbc:mysql://127.0.0.1/sakila

Just simply add the library to your project library. 只需将库添加到项目库即可。 Right click in Library on the Project you use 右键单击您使用的项目上的库

在此处输入图片说明

Then choose MySQL JDBC Driver 然后选择MySQL JDBC Driver

在此处输入图片说明

Then Click Add Library.So now we can connect to MySQL database 然后点击添加库,现在我们可以连接到MySQL数据库了

Resource : Java MySQL JDBC Tutorial using NetBeans (Part 1) 资源: 使用NetBeans的Java MySQL JDBC教程(第1部分)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM