eclipse连接mysql数据库

本文主要介绍了在Eclipse中连接MySQL数据库时遇到的两个问题及其解决方案。问题一是连接后仍有错误,通过参考相关链接进行了排查;问题二是db.properties文件中,发现需要移除?useSSL=false参数来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题一

Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.
Specify a driver template, then modify details in the fields below to provide a unique name, a list of required jars, and set any available and applicable property 
解决办法:
Solution for Problem:
mySQL, eclipse, Database Connections
Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.

In the Menu:

Window -> Preferences -> Data Management -> Driver Definition -> Add..

In "Name/Type" tab
Select "MySQL JDBC Driver" in your Version
Add something to "Driver Name" to make it unique

In "JAR List" tab:
be sure your mySQL JDBC connector is listed here. Otherwise download it and add it.

In "Properties" tab:
Connection URL : jdbc:mysql://yourHost:3306/databaseWhichExist
Database Name: databaseWhichExist
Driver Class: com.mysql.jdbc.Driver
Password: TheCorrectPassword
UserID: UserNameWhichExistInDatabase

这样结束之后还是有错误
详情:https://blog.csdn.net/dream_three/article/details/80718727

参考链接:

https://www.eclipse.org/forums/index.php/t/74927/
https://www.javahelps.com/2015/08/add-mysql-jdbc-driver-to-eclipse.html

问题二

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Public Key Retrieval is not allowed)
解决问题:

之前的db.properties

driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/eng?useSSL=false
username=root
password=988410

需要把?useSSL=false删掉

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值