gpt4 book ai didi

java.sql.SQLException : No suitable driver found for localhost/buddhiedgeserver_db 异常

转载 作者:行者123 更新时间:2023-11-29 05:35:26 24 4
gpt4 key购买 nike

<分区>

我正在尝试连接到 MySQL 5.5 数据库,如下所示:

public void getCon() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("localhost/buddhiedgeserver_db","root","amma");
System.out.println("Connection"+con);
}

但是,它抛出异常

java.sql.SQLException: No suitable driver found for localhost/buddhiedgeserver_db.

这是怎么引起的,我该如何解决?我使用的是 MyEclipse 9.1 版,我在类路径中包含了 mysql.jar

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com