Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the considerations for upgrading to mysql-connector-java8.0.27

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about upgrading to mysql-connector-java8.0.27 to share with you what points for attention, the editor thinks it is very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.

Recently, online security scanned a loophole in the mysql connector and took a look at the 5.1.47 version. It has been quite a long time indeed.

The recommendation is to upgrade to the latest version of 8.0.27

There will always be some problems with the upgrade, and the deployment was reported wrong after changing the connector.

# Error querying database. Cause: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource

I can't connect to the database.

Looking up the configuration file found that the classes for connection pooling configuration connections were not found.

After switching back to mysql-connector-java 5.1.47, this class can be found.

Looking at the source code of jar package, it is found that the path of the class connected to jdbc has been changed after changing mysql-connector-java 8.0.27, Tai Keng.

Finally, just change it to com.mysql.cj.jdbc.MysqlDataSource.

Finally, the database connection configuration of mysql8.0+ is attached.

Jdbc.driverClassName=com.mysql.cj.jdbc.Driver

Jdbc.url=jdbc:mysql://*?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true

The rest of the framework is configured as

4.3.29.RELEASE

3.4.0

1.3.0

These are the points for attention in upgrading to mysql-connector-java8.0.27, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report