jdbc快速入门这个错误怎么解决
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jdbc快速入门这个错误怎么解决相关的知识,希望对你有一定的参考价值。
mysql版本和和驱动jar包都是8.0.16,代码和错误如下"D:\idea\IntelliJ IDEA 2019.1.2\jre64\bin\java.exe" "-javaagent:D:\idea\IntelliJ IDEA 2019.1.2\lib\idea_rt.jar=2204:D:\idea\IntelliJ IDEA 2019.1.2\bin" -Dfile.encoding=UTF-8 -classpath D:\itcast\out\production\day04_jdbc;D:\itcast\day04_jdbc\libs\mysql-connector-java-8.0.16.jar cn.itcast.jdbc.jdbcDemo1Exception in thread "main" 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.
JDBC MySQL快速入门
import java.util.logging.Level; import java.util.logging.Logger; // import com.mysql.jdbc.*; import java.sql.*; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author sukanta */ public class Main { try { Class.forName("com.mysql.jdbc.Driver"); Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } stmt = con.createStatement(); while (result.next()) result.close(); con.close(); } }
以上是关于jdbc快速入门这个错误怎么解决的主要内容,如果未能解决你的问题,请参考以下文章