您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Spring使用JDBC错误总结

bubuko 2022/1/25 19:51:07 java 字数 2593 阅读 1018 来源 http://www.bubuko.com/infolist-5-1.html

1.?The server time zone value '?D1ú±ê×?ê±??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC drive ...

1. The server time zone value ‘Öйú±ê׼ʱ¼ä‘ 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 utili

由于时区原因导致错误,因为MySQL的默认时区是美国时区,需要修改成计算机当前所在时区即可。

    <!--配置JDBC数据源-->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/spring?serverTimezone=GMT%2B8"/>
        <property name="username" value="root"/>
        <property name="password" value="root"/>
    </bean>
jdbc:mysql://localhost:3306/spring?serverTimezone=GMT%2B8

设置时区后再进行连接即可解决

Spring使用JDBC错误总结

原文:https://www.cnblogs.com/chao666/p/12867089.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶