JDBC的坑

小白一枚,今天刚开始用JDBC就遇到问题。
一:java.sql.SQLException: 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 utilize time zone support.
两种解决办法:

  1. 将url改为:“jdbc:mysql://localhost:3306/emp?serverTimezone=GMT%2B8”
  2. 在命令行加一句设置失去时区的操作在这里插入图片描述
    二:Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
    Tue Nov 27 11:34:53 CST 2018 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    针对这个问题网上的解决办法大都是在url后面加一句:useSSL=false,但是我改来改去这个WARN一直都在。有其他办法的朋友欢迎留言。

猜你喜欢

转载自blog.csdn.net/Terminator1937/article/details/84563472