使用jdbcTemplate连接数据库,然后报这个错
Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone.
粗略地看是时区的问题
那需要对写的驱动进行更改了
将driver的内容改成这样就行了
就是在test后加上?serverTimezone=UTC
ds.setUrl(“jdbc:mysql://localhost:3306/test?serverTimezone=UTC”)
然后运行就行了
Failed to obtain JDBC Connection
最新推荐文章于 2024-04-30 18:18:00 发布