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 about the java.sql.SQLException exception?

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article will explain in detail how to do java.sql.SQLException exception. The content of the article is of high quality. Therefore, Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

New version of database driver connection exception

java.sql.SQLException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

The database used is MySQL and the driver is 8.0.16. This is due to the new version of the database driver connector needs to specify UTC time zone caused by the jdbc connection url after the serverTimezone=GMT can solve the problem, if you need to use gmt+8 time zone, need to write GMT%2B8, otherwise it will be resolved to null. Another solution is to use a lower version of MySQL jdbc driver, 5.1.28 does not have time zone problems.

After modification:

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://127.0.0.1:3306/wljkzx? useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8spring.datasource.username=rootspring. datasource.password=123 About java.sql.SQLException exception how to do to share here, I hope the above content can have some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

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

Internet Technology

Wechat

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

12
Report