时区设置问题
G:\JDK\jdk_H2J_1.8\bin\java.exe "-javaagent:G:\IDEA2020.2.3\IntelliJ IDEA 2020.2.3\lib\idea_rt.jar=56544:G:\IDEA2020.2.3\IntelliJ IDEA 2020.2.3\bin" -Dfile.encoding=UTF-8 -classpath "G:\JDK\jdk_H2J_1.8\jre\lib\charsets.jar;G:\JDK\jdk_H2J_1.8\jre\lib\deploy.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\access-bridge.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\cldrdata.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\dnsns.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\jaccess.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\jfxrt.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\localedata.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\nashorn.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\sunec.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\sunjce_provider.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\sunmscapi.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\sunpkcs11.jar;G:\JDK\jdk_H2J_1.8\jre\lib\ext\zipfs.jar;G:\JDK\jdk_H2J_1.8\jre\lib\javaws.jar;G:\JDK\jdk_H2J_1.8\jre\lib\jce.jar;G:\JDK\jdk_H2J_1.8\jre\lib\jfr.jar;G:\JDK\jdk_H2J_1.8\jre\lib\jfxswt.jar;G:\JDK\jdk_H2J_1.8\jre\lib\jsse.jar;G:\JDK\jdk_H2J_1.8\jre\lib\management-agent.jar;G:\JDK\jdk_H2J_1.8\jre\lib\plugin.jar;G:\JDK\jdk_H2J_1.8\jre\lib\resources.jar;G:\JDK\jdk_H2J_1.8\jre\lib\rt.jar;G:\Java Project\IMMOC_Practice\ricardo\JDBCDemo1\out\production\JDBCDemo1;G:\Java Project\IMMOC_Practice\ricardo\JDBCDemo1\src\lib\mysql-connector-java-8.0.16.jar" com.imooc.jdbc.sample.StandardJDBCSample
java.sql.SQLException: No timezone mapping entry for 'Asin/Shanghai'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:85)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.imooc.jdbc.sample.StandardJDBCSample.main(StandardJDBCSample.java:16)
Caused by: com.mysql.cj.exceptions.WrongArgumentException: No timezone mapping entry for 'Asin/Shanghai'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2132)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2142)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1310)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
... 6 more
Process finished with exit code 0
问下,这个时区设置错误怎么解决?我按照老师的写了url(
"jdbc:mysql://localhost:3306/immoc?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asin/Shanghai"
)之后,报错信息变成了没有Shanghai这个时区
13
收起
正在回答 回答被采纳积分+1
1回答
java工程师2020版
- 参与学习 人
- 提交作业 9393 份
- 解答问题 16556 个
综合就业常年第一,编程排行常年霸榜,无需脱产即可学习,北上广深月薪过万 无论你是未就业的学生还是想转行的在职人员,不需要基础,只要你有梦想,想高薪
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星